Skip to content

Commit

Permalink
Revert "[JENKINS-48061] Non GitSCMHeadMixin should be a branch"
Browse files Browse the repository at this point in the history
This reverts commit 68a956f.
  • Loading branch information
rsandell committed Mar 27, 2018
1 parent 0cc223c commit 1d38888
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
Expand Up @@ -384,12 +384,11 @@ public SCMRevision run(GitClient client, String remoteName) throws IOException,
// tag does not exist
return null;
}
} else if (head instanceof GitBranchSCMHead || !(head instanceof GitSCMHeadMixin)) {
GitBranchSCMHead branchHead = (head instanceof GitBranchSCMHead) ? (GitBranchSCMHead)head : new GitBranchSCMHead(head.getName());
} else if (head instanceof GitBranchSCMHead) {
for (Branch b : client.getRemoteBranches()) {
String branchName = StringUtils.removeStart(b.getName(), remoteName + "/");
if (branchName.equals(head.getName())) {
return new GitBranchSCMRevision(branchHead, b.getSHA1String());
return new GitBranchSCMRevision((GitBranchSCMHead)head, b.getSHA1String());
}
}
} else if (head instanceof GitRefSCMHead) {
Expand Down

0 comments on commit 1d38888

Please sign in to comment.