As soon as I attempted to upgrade my Jenkins job to use a parameter for the branch rather than a hard coded value it no longer works.
Have tried many other names than BUILD_BRANCH
Here I've tried ${env.BUILD_BRANCH}, refs/heads${BUILD_BRANCH} and absolutely none of them work
When I did this initially I did check lightweight checkout, I removed it after reading many online answers from those having the same problem. Still nothing!. I just added the 'wipe' command to see if that would help but it didn't
error:
> git rev-list --no-walk 97428a402f3304a21ccc8df435a40468ebf406c1 # timeout=10
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] readTrusted
[Pipeline] End of Pipeline
hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune -- origin +refs/heads/${BUILD_BRANCH}:refs/remotes/origin/${BUILD_BRANCH}" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/${BUILD_BRANCH}
fatal: The remote end hung up unexpectedly
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429)
Thank you for reading even if you couldn't help