Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53346

GitSCM checkout returns same values on second different call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor 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.

            mramonleon Ramon Leon
            bspickers Bernd Spickers
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: