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

Error cloning repositories where there is a branch with quotes in the name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins: 2.414.2
      Git Plugin: 5.2.0
      Git Version: 2.19.1.windows.1

      When cloning a repository to a clean working copy, if the repository contains a branch whose name contains double quotes, the clone fails.  See output below.

      14:12:10 Started by an SCM change
      14:12:10 Running as SYSTEM
      14:12:10 Building remotely on **** (windows10) in workspace d:\path
      14:12:10 The recommended git tool is: NONE
      14:12:10 No credentials specified
      14:12:10  > git rev-parse --resolve-git-dir d:\path\.git # timeout=10
      14:12:10 Fetching changes from the remote Git repository
      14:12:10  > git config remote.origin.url git@thing:org/repo.git # timeout=10
      14:12:10 Fetching upstream changes from git@thing:org/repo.git
      14:12:10  > git --version # timeout=10
      14:12:10  > git --version # 'git version 2.19.1.windows.1'
      14:12:10  > git fetch --tags --progress -- git@thing:org/repo.git +refs/heads/*:refs/remotes/origin/* # timeout=10
      14:12:14 ERROR: Error fetching remote repo 'origin'
      14:12:14 hudson.plugins.git.GitException: Failed to fetch from git@thing:org/repo.git
      14:12:14     at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
      14:12:14     at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241)
      14:12:14     at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
      14:12:14     at hudson.scm.SCM.checkout(SCM.java:540)
      14:12:14     at hudson.model.AbstractProject.checkout(AbstractProject.java:1245)
      14:12:14     at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
      14:12:14     at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
      14:12:14     at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521)
      14:12:14     at hudson.model.Run.execute(Run.java:1900)
      14:12:14     at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
      14:12:14     at hudson.model.ResourceController.execute(ResourceController.java:101)
      14:12:14     at hudson.model.Executor.run(Executor.java:442)
      14:12:14 Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress -- git@thing:org/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 1:
      14:12:14 stdout: 
      14:12:14 stderr: remote: Enumerating objects: 4, done.        
      14:12:14 remote: Counting objects:  25% (1/4)        
      remote: Counting objects:  50% (2/4)        
      remote: Counting objects:  75% (3/4)        
      remote: Counting objects: 100% (4/4)        
      remote: Counting objects: 100% (4/4), done.        
      14:12:14 remote: Compressing objects:  25% (1/4)        
      remote: Compressing objects:  50% (2/4)        
      remote: Compressing objects:  75% (3/4)        
      remote: Compressing objects: 100% (4/4)        
      remote: Compressing objects: 100% (4/4), done.        
      14:12:14 remote: Total 4 (delta 0), reused 1 (delta 0), pack-reused 0        
      14:12:14 error: cannot lock ref 'refs/remotes/origin/More-"any"-fixes': Unable to create 'd:/path/.git/refs/remotes/origin/More-"any"-fixes.lock': Invalid argument
      14:12:14 From thing:org/repo
      14:12:14  ! [new branch]              More-"any"-fixes -> origin/More-"any"-fixes  (unable to update local ref)
      14:12:14  * [new branch]              TestBranch       -> origin/TestBranch
      14:12:14    29482c34085..c4dfa77c5c8  develop          -> origin/develop
      14:12:14  * [new branch]              fsexportspike    -> origin/fsexportspike
      14:12:14 
      14:12:14     at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842)
      14:12:14     at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
      14:12:14     at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
      14:12:14     at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:170)
      14:12:14     at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
      14:12:14     at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      14:12:14     at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      14:12:14     at hudson.remoting.Request$2.run(Request.java:377)
      14:12:14     at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
      14:12:14     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      14:12:14     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      14:12:14     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      14:12:14     at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:125)
      14:12:14     at java.base/java.lang.Thread.run(Thread.java:829)
      14:12:14     Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from **.**.**.**/**.**.**.**:49893
      14:12:14         at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
      14:12:14         at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      14:12:14         at hudson.remoting.Channel.call(Channel.java:1000)
      14:12:14         at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:153)
      14:12:14         at jdk.internal.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
      14:12:14         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      14:12:14         at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      14:12:14         at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:138)
      14:12:14         at com.sun.proxy.$Proxy73.execute(Unknown Source)
      14:12:14         at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:997)
      14:12:14         at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241)
      14:12:14         at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
      14:12:14         at hudson.scm.SCM.checkout(SCM.java:540)
      14:12:14         at hudson.model.AbstractProject.checkout(AbstractProject.java:1245)
      14:12:14         at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
      14:12:14         at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
      14:12:14         at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521)
      14:12:14         at hudson.model.Run.execute(Run.java:1900)
      14:12:14         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
      14:12:14         at hudson.model.ResourceController.execute(ResourceController.java:101)
      14:12:14         at hudson.model.Executor.run(Executor.java:442)
      14:12:14 ERROR: Error fetching remote repo 'origin' 

            Unassigned Unassigned
            samgryphons Sam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: