title: Use lightweight pipeline checkout from SCM with parameter as ref
body: <p>I am trying to run a pipeline script which is located in a very large git repo.
  I can use the "Lightweight Checkout" for the "Pipeline script from SCM" (using Bitbucket) and that works fine.</p>
  
  <p>However - the job needs to have a parameter BRANCH to specify which branch to get it from.</p>
  
  <p>When I use "${BRANCH}" in the "Branch Specifier", I get this:</p>
  
  <p><code>hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH} --prune" returned status code 128:
  stdout: 
  stderr: fatal: Couldn't find remote ref refs/heads/${BRANCH}
  </code></p>
  
  <p>Any ideas on how to do a lightweight checkout of a pipeline script for a branch that is passed as parameter?</p>