Show the current checked out HEAD if no branch is selected

This commit is contained in:
Pieter de Bie
2008-08-19 00:25:32 +02:00
parent 9b6974bf31
commit d39648e8d4
+7 -1
View File
@@ -29,7 +29,13 @@
// We use refparse to get the commit sha that we will parse. That way,
// we can check if the current branch is the same as the previous one
// and in that case we don't have to reload the revision list.
NSString* newRef = [repository parseReference:[repository currentBranch]];
// If no branch was selected, use the current HEAD
NSString* newRef = [repository currentBranch];
if (!newRef || [newRef isEqualToString:@""])
newRef = @"HEAD";
newRef = [repository parseReference:newRef];
if ([newRef isEqualToString:currentRef])
return;