Skip to content

Commit 4116bfe

Browse files
committed
When given a bare name for branch enumeration, try to resolve it to a commit
1 parent cc9b7fd commit 4116bfe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Classes/git/PBGitRevList.mm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ - (void) setupEnumerator:(GTEnumerator*)enumerator
189189
} else if ([param hasPrefix:@"--glob="]) {
190190
[enumerator pushGlob:[param substringFromIndex:@"--glob=".length] error:&error];
191191
} else {
192-
[enumerator pushGlob:param error:&error];
192+
NSError *lookupError = nil;
193+
GTObject *obj = [repo lookUpObjectByRevParse:param error:&lookupError];
194+
if (obj && !lookupError) {
195+
[self addGitObject:obj toCommitSet:enumCommits];
196+
} else {
197+
[enumerator pushGlob:param error:&error];
198+
}
193199
}
194200
}
195201
}

0 commit comments

Comments
 (0)