-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Production
Git plugin ver: 2.4.4
In jenkins job we configure Git plugin ->
Branches to build/Branch specifier: origin/ready/**
Developer pushes code to central git repository, which Jenkins check into 2 branches:
git push origin bugfix:sergey/bugfix
git push origin bugfix:ready/bugfix
When Jenkins job kicks in, it provides this output:
14:01:36 > git branch -a -v --no-abbrev --contains 24ef859065480d5ac965652cfce8a0dd959fd082 # timeout=10
14:01:36 Checking out Revision 24ef859065480d5ac965652cfce8a0dd959fd082 (origin/sergey/bugfix, origin/ready/bugfix)
..
..
14:01:36 HOME=/var/lib/jenkins
14:01:36 GIT_BRANCH=origin/sergey/bugfix
14:01:36 EXECUTOR_NUMBER=1
As you can see GIT_BRANCH got set to "origin/sergey/bugfix"
and this is wrong because we asked for branch to match origin/ready/**
This causes problems in our build process
- is related to
-
JENKINS-35162 git plugin does not respect refspec
-
- Closed
-
[JENKINS-33984] Git plugin sets wrong branch name GIT_BRANCH (more than 2 branches with same SHA1)
Assignee | Original: Mark Waite [ markewaite ] |
Attachment | New: screenshot-1.png [ 32376 ] |
Attachment | New: screenshot-2.png [ 32377 ] |
Attachment | Original: screenshot-2.png [ 32377 ] |
Attachment | Original: screenshot-1.png [ 32376 ] |
Attachment | New: screenshot-1.png [ 32378 ] |
You might try using the local branch extension that was added in git plugin 2.4.4. It may be able to checkout the branch which matches the name from the branch spec, rather than reporting the name of the first branch mentioned in the rev-parse output.