Skip to content
Permalink
Browse files

[JENKINS-48061] Non GitSCMHeadMixin should be a branch

  • Loading branch information...
rsandell committed Mar 27, 2018
1 parent ceabe36 commit 68a956f9c3180e75b8c3c1b7d43ca2f870a82e9d
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
@@ -384,11 +384,12 @@ public SCMRevision run(GitClient client, String remoteName) throws IOException,
// tag does not exist
return null;
}
} else if (head instanceof GitBranchSCMHead) {
} else if (head instanceof GitBranchSCMHead || !(head instanceof GitSCMHeadMixin)) {
GitBranchSCMHead branchHead = (head instanceof GitBranchSCMHead) ? (GitBranchSCMHead)head : new GitBranchSCMHead(head.getName());
for (Branch b : client.getRemoteBranches()) {
String branchName = StringUtils.removeStart(b.getName(), remoteName + "/");
if (branchName.equals(head.getName())) {
return new GitBranchSCMRevision((GitBranchSCMHead)head, b.getSHA1String());
return new GitBranchSCMRevision(branchHead, b.getSHA1String());
}
}
} else if (head instanceof GitRefSCMHead) {

0 comments on commit 68a956f

Please sign in to comment.
You can’t perform that action at this time.