Skip to content
Permalink
Browse files

[JENKINS-48061] Move HEAD check to top

  • Loading branch information...
rsandell committed Apr 4, 2018
1 parent bcd0e20 commit 2cc15228d0b34bfcc13d4f1e58dcd79344faaa3c
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
@@ -738,6 +738,10 @@ protected SCMRevision retrieve(@NonNull final String revision, @NonNull final Ta
for (Map.Entry<String,ObjectId> entry: remoteReferences.entrySet()) {
String name = entry.getKey();
String rev = entry.getValue().name();
if ("HEAD".equals(name)) {
//Skip HEAD as it should only appear during testing, not for standard bare repos iirc
continue;
}
if (name.equals(Constants.R_HEADS + revision)) {
listener.getLogger().printf("Found match: %s revision %s%n", name, rev);
// WIN!
@@ -763,10 +767,6 @@ protected SCMRevision retrieve(@NonNull final String revision, @NonNull final Ta
fullTagMatches.add(name);
continue;
}
if ("HEAD".equals(name)) {
//Skip HEAD as it should only appear during testing, not for standard bare repos iirc
continue;
}
if (rev.toLowerCase(Locale.ENGLISH).equals(revision.toLowerCase(Locale.ENGLISH))) {
fullHashMatches.add(name);
if (fullHashMatch == null) {

0 comments on commit 2cc1522

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