title: Jenkins parameterized build: build fails due to git parameter includes {^commit}
body: <p>I would like to set up a parameterized build so the user can select branch and then  press "build" to build that branch.</p>
  
  <p>In configure I have added a git parameter "branch", like this:
  <a href="https://i.stack.imgur.com/7GzKl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7GzKl.png" alt="enter image description here"></a></p>
  
  <p>I have then added the "branch" parameter as branch specifier in the pipeline definition like this:
  <a href="https://i.stack.imgur.com/fOpou.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fOpou.png" alt="enter image description here"></a></p>
  
  <p>When I start the build, I can select the branch without a problem. In this example /origin/feature/kvarntorp-test1. 
  But the build will fail with the following console output:</p>
  
  <blockquote>
    <p>Started by user xxxx Lightweight checkout support not available,
    falling back to full checkout. Checking out git
    ssh://gitolite@tuleap.ermms.se/ermms/acm.git into
    /var/lib/jenkins/workspace/6smCustomBuild@script to read
    ci/jenkins/6msBuildAndTest.groovy</p>
    
    <p>&gt; git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository
    <br/>
     &gt; git config remote.origin.url ssh://gitolite@tuleap.ermms.se/ermms/acm.git # timeout=10 Fetching
    upstream changes from ssh://gitolite@tuleap.ermms.se/ermms/acm.git
    <br/>
     &gt; git --version # timeout=10 using GIT_SSH to set credentials 
    <br/>
     &gt; git fetch --tags --progress ssh://gitolite@tuleap.ermms.se/ermms/acm.git
    +refs/heads/<em>:refs/remotes/origin/</em>
    <br/>
     &gt; git rev-parse /origin/feature/kvarntorp-test1^{commit} # timeout=10
    <br/>
     &gt; git rev-parse refs/remotes/origin//origin/feature/kvarntorp-test1^{commit} #
    timeout=10
    <br/>
    &gt; git rev-parse /origin/feature/kvarntorp-test1^{commit} # timeout=10 </p>
    
    <p>ERROR: Couldn't find any revision to build. Verify the repository and
    branch configuration for this job. 
    <br/>
    ERROR: Maximum checkout retry
    attempts reached, aborting Finished: FAILURE</p>
  </blockquote>
  
  <p>So Jenkins can not find the branch /origin/feature/kvarntorp-test1 because he is searching for /origin/feature/kvarntorp-test1^{commit}</p>
  
  <p>Where did ^{commit} come from? Can I somehow remove the ^{commit} in the build configuration?
  Have I configured the build wrong?</p>
  
  <p>I have tried different names instead of "branch". <a href="https://stackoverflow.com/questions/23906352/git-pullrequest-job-failed-couldnt-find-any-revision-to-build-verify-the-repo">Git PullRequest job failed. Couldn&#39;t find any revision to build. Verify the repository and branch configuration for this job</a> suggests I should use sha1 with the default value "master". I tried sha1 as Git Parameter Name and ${sha1} as Branch Specifier. The build failed with the following console output:</p>
  
  <pre>
  hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${sha1}:refs/remotes/origin/${sha1} --prune" returned status code 128:
  stdout: 
  stderr: fatal: Couldn't find remote ref refs/heads/${sha1}
  fatal: The remote end hung up unexpectedly
  
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2002)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1721)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
      at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:351)
      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:108)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:298)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
  Finished: FAILURE
  </pre>