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

GitSCM checkout returns same values on second different call

    • 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.

          [JENKINS-53346] GitSCM checkout returns same values on second different call

          Bernd Spickers created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s New: pipeline [ 21692 ]
          Mark Waite made changes -
          Summary Original: GitScm checkout returns same values on second different call New: GitSCM checkout returns same values on second different call
          Andrew Bayer made changes -
          Component/s New: workflow-scm-step-plugin [ 21717 ]
          Component/s Original: pipeline [ 21692 ]
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-54732 [ JENKINS-54732 ]
          Devin Nusbaum made changes -
          Link New: This issue is duplicated by JENKINS-55040 [ JENKINS-55040 ]
          Mark Waite made changes -
          Description Original: 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?

           
          New: 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.
          Ramon Leon made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Ramon Leon made changes -
          Remote Link New: This issue links to "Pull #1050 (Web Link)" [ 26526 ]
          Ramon Leon made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

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

              Created:
              Updated:
              Resolved: