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

Git fetch fails when "Branch Specifier" uses a parameter in new version of the Git plugin

      In a pipeline job from a git repository where the "Branch Specifier" is given as a parameter, I started getting the following failure after updating the git plugin.

      hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/$\{GITREF}:refs/remotes/origin/$\{GITREF} --prune" returned status code 128:
      stdout: 
      stderr: fatal: Couldn't find remote ref refs/heads/$\{GITREF}
      
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1799)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1525)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:65)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:316)
              at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:304)
              at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
              at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
              at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:99)
              at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
              at hudson.model.ResourceController.execute(ResourceController.java:98)
              at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

      I have tested all released version of the git plugin from 3.0.1 to 3.2.0 and the failure seems to have appeared in 3.0.2.

      I don't know if it is relevant but with the Git plugin version 3.0.1, I see this at the beginning of the log:
      Lightweight checkout support not available, falling back to full checkout.
       

          [JENKINS-43818] Git fetch fails when "Branch Specifier" uses a parameter in new version of the Git plugin

          Grégoire Détrez created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Grégoire Détrez made changes -
          Attachment New: Screenshot from 2017-03-28 17-14-05.png [ 37900 ]
          Grégoire Détrez made changes -
          Attachment New: Selection_001.png [ 37901 ]
          Grégoire Détrez made changes -
          Attachment Original: Screenshot from 2017-03-28 17-14-05.png [ 37900 ]
          Denys Digtiar made changes -
          Attachment New: lightweight-checkout-doco.png [ 37913 ]
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Sam Duke made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Sam Duke made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Sam Duke made changes -
          Labels Original: regression New: feature-improvement regression
          Sam Duke made changes -
          Assignee New: Denys Digtiar [ duemir ]

            Unassigned Unassigned
            gd13 Grégoire Détrez
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: