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

Git checkout fails with recommended unambiguous branch name

    Details

    • Similar Issues:

      Description

      When setting up jenkins to clone a git repo the branch specifier is recommended: The safest way is to use the refs/heads/<branchName> syntax. This way the expected branch is unambiguous.

      However it fails to checkout the workspace if the full branchname is used. :

      quote
      15:27:24 Started by an SCM change
      15:27:24 Building remotely on ip-172-31-10-241.us-west-1.compute.internal (swarm buildslave) in workspace /home/jenkins-slave/workspace/Idev_euslisp_ubuntu_trusty_amd64
      15:27:24 > git rev-parse --is-inside-work-tree # timeout=10
      15:27:24 Fetching changes from the remote Git repository
      15:27:24 > git config remote.origin.url https://github.com/tork-a/euslisp-release.git # timeout=10
      15:27:24 Fetching upstream changes from https://github.com/tork-a/euslisp-release.git
      15:27:24 > git --version # timeout=10
      15:27:24 > git -c core.askpass=true fetch --tags --progress https://github.com/tork-a/euslisp-release.git +refs/heads/:refs/remotes/origin/
      15:27:24 > git rev-parse refs/head/release/indigo/euslisp^

      {commit} # timeout=10
      15:27:24 > git rev-parse refs/remotes/origin/refs/head/release/indigo/euslisp^{commit}

      # timeout=10
      15:27:24 > git rev-parse refs/head/release/indigo/euslisp^

      {commit}

      # timeout=10
      15:27:24 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      quote

      To make this work the rev-parse needs the shortened refspec or to pass through exactly what is passed to it.

      quote
      $ git rev-parse release/indigo/euslisp
      445d613f27d3cf28291919f29ccfbe4482082ae5
      quote

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          I believe this is fixed with git plugin 2.4.0 and git client plugin 1.18.0, both released 18 Jul 2015.

          Show
          markewaite Mark Waite added a comment - I believe this is fixed with git plugin 2.4.0 and git client plugin 1.18.0, both released 18 Jul 2015.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              tfoote Tully Foote
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: