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

checkout(scm) step can return wrong variables when used following another Git checkout

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • scm-api-plugin
    • None
    • git plugin 4.7.0 released 17 Mar 2021

      This looks like the same type of code-path issue described in https://issues.jenkins-ci.org/browse/JENKINS-41996 

       

      @Library('someGitLibrary')
      
      node {
        final scmVars = checkout(scm)
        // scmVars may have Git data from either the someGitLibrary or the scmVars
       }

       

      Looks like its caused by https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L1282-L1317 

       

          [JENKINS-45489] checkout(scm) step can return wrong variables when used following another Git checkout

          Mike Kobit created issue -
          Mike Kobit made changes -
          Description Original: This looks like the same type of code-path issue described in https://issues.jenkins-ci.org/browse/JENKINS-41996 

           
          {code:java}
          @Library('someGitLibrary')

          node {
            final scmVars = checkout(scm)
            // scmVars may have Git data from either the
          }{code}
           

          Looks like its caused by [https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L1282-L1317

           
          New: This looks like the same type of code-path issue described in https://issues.jenkins-ci.org/browse/JENKINS-41996 

           
          {code:java}
          @Library('someGitLibrary')

          node {
            final scmVars = checkout(scm)
            // scmVars may have Git data from either the someGitLibrary or the scmVars
           }{code}
           

          Looks like its caused by [https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L1282-L1317

           
          Mark Waite made changes -
          Component/s New: scm-api-plugin [ 18054 ]
          Component/s Original: git-plugin [ 15543 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Wright made changes -
          Summary Original: checkout(scm) step can return wrong variables when used with a global library that is pulled from Git New: checkout(scm) step can return wrong variables when used following another Git checkout
          Mark Wright made changes -
          Link New: This issue is blocked by JENKINS-52378 [ JENKINS-52378 ]
          Mark Waite made changes -
          Link New: This issue duplicates JENKINS-53346 [ JENKINS-53346 ]
          Mark Waite made changes -
          Released As New: git plugin 4.7.0 released 17 Mar 2021
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            mkobit Mike Kobit
            Votes:
            9 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: