-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Maybe related to #91.
As far as I can tell, PBGitHistoryController:
- refreshes the history view whenever GitX gains focus
- tries to restore the selected commit when doing this, but fails.
I poked around in the debugger and found:
- (NSArray *) selectedObjectsForSHA:(NSString *)commitSHA
{
NSPredicate *selection = [NSPredicate predicateWithFormat:@"sha == %@", commitSHA];
NSArray *selectedCommits = [[commitController content] filteredArrayUsingPredicate:selection];
if (([selectedCommits count] == 0) && [self firstCommit])
selectedCommits = [NSArray arrayWithObject:[self firstCommit]];
return selectedCommits;
}
We come in with commitSHA equal to some commit e.g. "c2ec9ea..." which exists in the repository and is, in fact, the commit that was selected when the gitx window lost focus.
The NSPredicate looks plausible (I'm a total Cocoa nooob), but [commitController content] is delivering an empty NSArray, so selectedCommits ends up as an empty NSArray. I have no theories on why that could be.
The result of all this is that the list of selected commits comes back empty and PBGitHistoryController improvises by selecting the HEAD of the current branch instead of restoring the last selected commit.
This is absolutely maddening as I've grown accustomed to using gitx to do code reviews, which means a lot of command-tabbing back and forth between gitx and the IDE/Editor.