Skip to content

Commit

Permalink
PBRefController: Only set title if we have a rev
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pieter committed Jan 19, 2009
1 parent bad99be commit 971e8e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PBRefController.m
Expand Up @@ -296,7 +296,8 @@ - (void) changeBranch:(NSMenuItem *)sender
- (void) selectCurrentBranch
{
PBGitRevSpecifier *rev = historyController.repository.currentBranch;
[branchPopUp setTitle:[rev description]];
if (rev)
[branchPopUp setTitle:[rev description]];
}

@end

0 comments on commit 971e8e5

Please sign in to comment.