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

Git checkout fails on second build if local branch to merge to is specified as a parameter.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • jenkins 1.503, osx, latest git plugin

      I am using the Envinject plugin to set some pre-scm variables.

      When I specify the local branch to merge to as a parameter, the first build is able to check out (then fails for other reasons).

      On the second build, the build will fail with the stack trace that follows. If I replace the variable with the name it resolves to, it works fine.


      12:56:03 FATAL: Command "/usr/local/git/bin/git checkout -b ${DATA_DEPLOY_BRANCH} e60ebf368ec03b4e4dd449427d50115203049218" returned status code 128:
      12:56:03 stdout:
      12:56:03 stderr: fatal: A branch named 'mybranch' already exists.
      12:56:03
      12:56:03 hudson.plugins.git.GitException: Command "/usr/local/git/bin/git checkout -b ${DATA_DEPLOY_BRANCH} e60ebf368ec03b4e4dd449427d50115203049218" returned status code 128:
      12:56:03 stdout:
      12:56:03 stderr: fatal: A branch named 'mybranch' already exists.
      12:56:03
      12:56:03 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772)
      12:56:03 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:738)
      12:56:03 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:748)
      12:56:03 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkout(CliGitAPIImpl.java:845)
      12:56:03 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1283)
      12:56:03 at hudson.plugins.git.GitSCM.access$1100(GitSCM.java:57)
      12:56:03 at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1232)
      12:56:03 at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1208)
      12:56:03 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
      12:56:03 at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      12:56:03 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      12:56:03 at hudson.remoting.Request$2.run(Request.java:326)
      12:56:03 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      12:56:03 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      12:56:03 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      12:56:03 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      12:56:03 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      12:56:03 at hudson.remoting.Engine$1$1.run(Engine.java:58)
      12:56:03 at java.lang.Thread.run(Thread.java:722)

            Unassigned Unassigned
            b2jrock b2jrock
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: