How to reproduce
(Assuming you have a GitHub Organization folder with WebHooks already setup)
1. Fork a repo
2. Create a branch
3. Make a change
4. Make a commit
5. Create a pull request against the remote master
6. Commit successively multiple changes very quickly - 2/3 seconds interval
(Usually 5 commit suffice)
7. You should see the PR build failing with the following exception:
hudson.plugins.git.GitException: Could not checkout 67615299b8ef9ae83a60c72af7ca37cbfc879d4f
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1992)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1135)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:109)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:87)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:206)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git checkout -f 67615299b8ef9ae83a60c72af7ca37cbfc879d4f" returned status code 128:
stdout:
stderr: fatal: reference is not a tree: 67615299b8ef9ae83a60c72af7ca37cbfc879d4f
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:63)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1984)
... 7 more
Finished: FAILURE
Example
Following have been committed within 10 seconds in that order:
1. 4fba098fd8127befb73e751f58d31129abfec323
2. 84765a178a5516dbabfb9d0cbf17ee08129a00c4 -> triggered branch indexing
3. 67615299b8ef9ae83a60c72af7ca37cbfc879d4f
Checking in the indexing logs, the Branch Indexing detected changes for PR-13, sha 84765a178a5516dbabfb9d0cbf17ee08129a00c4:
Changes detected in PR-13 (12d4896a25dcf71c7febc379f55e84841c4dde69 → 84765a178a5516dbabfb9d0cbf17ee08129a00c4)
Scheduled build for branch: PR-13
The next indexing logs, probably triggered by 67615299b8ef9ae83a60c72af7ca37cbfc879d4f, shows:
No changes detected in PR-13 (still at 84765a178a5516dbabfb9d0cbf17ee08129a00c4)