-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
Jenkins 1.460, git plugin 1.1.17
In a repository with multiple branches, Jenkins frequently builds a commit other than the head of the selected branch. For example, it builds HEAD^ from the master branch.
I am selecting the branch to build based on a parameter $BRANCH, which defaults to **, and the problem occurs with this value. If I set BRANCH to "origin/master" explicitly, then I get the latest commit as expected.
I'm having issues with this on Jenkins 2.7.1, git plugin 2.5.3. I have a plugin installed that builds pull requests from a Stash instances, very similar to the GitHub pull request builder (which is also having issues, see JENKINS-31686). Frequently, but not always, it will instead build an old commit instead of the newest one on the branch. Given that this has been seen across different Git PR plugins, I think the git plugin itself is the culprate.
More info:
Refspec:
Branch Specifier: origin/pr/${pullRequestId}/from
Where
is an environment variable that contains the Stash PR number.