-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins 2.121.3, Git plugin 3.9.1, Pipeline SCM step 2.6
-
-
git plugin 4.7.0
Hi,
if I run within a pipeline job, the checkout command twice to checkout different commits, the returnvalue of this call has two times the same values, even if the branches and commits are different.
E.g:
def scm1 = checkout (changelog: false, poll: false, verboseEnabled: false, scm: [$class: 'GitSCM',
branches: [[name: 'refs/tags/TAG1']], ....)
def scm2 = checkout (changelog: false, poll: false, verboseEnabled: false, scm: [$class: 'GitSCM',
branches: [[name: 'refs/tags/TAG2']], ...)
the Maps scm1 and scm2 contain the same values, even if the tags are on different commits.
And the values are always from the first checkout .
So how can I get such values from the second checkout?
Note that this problem is specific to performing multiple checkouts from the same repository with different SHA1 hashes in the same Pipeline job. If different repositories are used in the same Pipeline job, refer to JENKINS-39968.
- is duplicated by
-
JENKINS-55040 Problem sharing data objects between parallel build stages
-
- Resolved
-
-
JENKINS-45489 checkout(scm) step can return wrong variables when used following another Git checkout
-
- Closed
-
- is related to
-
JENKINS-54732 Revision information produced by pipline 'checkout' operation isn't parallel safe
-
- Open
-
- links to
I've confirmed that the bug exists as reported. The map returned by the second checkout has the same values as the map returned by the first checkout.
Refer to the Jenkinsfile in my JENKINS-53346 test branch for an alternative to obtain the same information using a shell call.