retain selected commit position in commit history

ticket #281
This commit is contained in:
apla
2011-03-30 00:58:42 +04:00
parent 6d95d179ab
commit 8cafefbb8f
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -55,6 +55,7 @@
PBGitTree *gitTree;
PBGitCommit *webCommit;
PBGitCommit *selectedCommit;
PBGitCommit *selectedCommitBeforeRefresh;
}
@property (readonly) NSTreeController* treeController;
+4 -1
View File
@@ -250,7 +250,9 @@
}else if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) {
[self updateStatus];
if ([repository.currentBranch isSimpleRef])
if (selectedCommitBeforeRefresh && [repository commitForSHA:[selectedCommitBeforeRefresh sha]])
[self selectCommit:[selectedCommitBeforeRefresh sha]];
else if ([repository.currentBranch isSimpleRef])
[self selectCommit:[repository shaForRef:[repository.currentBranch ref]]];
else
[self selectCommit:[[self firstCommit] sha]];
@@ -405,6 +407,7 @@
- (IBAction) refresh:(id)sender
{
selectedCommitBeforeRefresh = selectedCommit;
[repository forceUpdateRevisions];
}