Unfortunately, this does not seem to be fixed (for me, at least) in 2.0.1.
Steps to reproduce:
1. Create a new job. Use a git repo with multiple branches. Set the 'Branches to build > Branch specifier' to a specific branch, e.g. 'feature/my-feature'
2. Run a build
Result:
Notes:
- the clone works fine if I don't specify a branch
- even after a successful clone, if I edit the job config to specify a branch, it fails with the same error as above.
I don't know much about the internals of the Git plugin, but it looks like it's not doing a fetch, so it doesn't know what remote branches are available.
The git-client-plugin 1.10.0 supports refs/remotes/origin/master as a way to fully qualify the reference to the origin/master branch. Refer to the online help and to
JENKINS-20767for more information.