| This happens because tags are now supported at https://github.com/jenkinsci/git-plugin/blob/git-4.2.1/src/main/java/jenkins/plugins/git/GitSCMFileSystem.java#L262-L264. But when the GitSCMFileSystem is used, the branch specified is not expanded. If you remove that support, it works again. We can see that all those duplicates are about refs/tags and not refs/heads and the *lightweight checkout* (i.e. GitSCMFileSystem). If you try a parameterized refs/heads/ like for example refs/heads/$BRANCH you will notice that it does not work with either version 4.1.1 or 4.2.2. People are impact because now lightweight checkout supports tags, lightweight checkout is enabled by default, but the current implementation of the lightweight checkout does not expand variables. The workaround is to disable lightweight checkout if you use refs/tags. The fix is to support variable expansion of the branch specifier in GitSCMFileSystem. |