Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-48061] Non GitSCMHeadMixin should be a branch
- Loading branch information
Showing
with
3 additions
and
2 deletions.
-
+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) { |
|
|