Skip to content

Commit 971e8e5

Browse files
committed
PBRefController: Only set title if we have a rev
We used to unconditionally set the title of the branch to the current branch. This worked fine in most cases where the current branch was already known, but failed when you use 'gitx -c' and then switch to the HistoryView, because then the currentBranch isn't known yet. The simple fix is to check if we know it. If we don't, it'll be set later on.
1 parent bad99be commit 971e8e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PBRefController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ - (void) changeBranch:(NSMenuItem *)sender
296296
- (void) selectCurrentBranch
297297
{
298298
PBGitRevSpecifier *rev = historyController.repository.currentBranch;
299-
[branchPopUp setTitle:[rev description]];
299+
if (rev)
300+
[branchPopUp setTitle:[rev description]];
300301
}
301302

302303
@end

0 commit comments

Comments
 (0)