@@ -248,16 +248,20 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
248
248
}else if ([context isEqualToString: @" branchFilterChange" ]) {
249
249
[PBGitDefaults setBranchFilter: repository.currentBranchFilter];
250
250
[self updateBranchFilterMatrix ];
251
- }else if ([context isEqualToString: @" updateCommitCount" ] || [(NSString *)context isEqualToString: @" revisionListUpdating" ]) {
252
- [self updateStatus ];
253
-
254
- if (selectedCommitBeforeRefresh && [repository commitForSHA: [selectedCommitBeforeRefresh sha ]])
255
- [self selectCommit: [selectedCommitBeforeRefresh sha ]];
256
- else if ([repository.currentBranch isSimpleRef ])
257
- [self selectCommit: [repository shaForRef: [repository.currentBranch ref ]]];
258
- else
259
- [self selectCommit: [[self firstCommit ] sha ]];
260
- }else {
251
+ }
252
+ else if ([context isEqualToString: @" updateCommitCount" ] || [(NSString *)context isEqualToString: @" revisionListUpdating" ]) {
253
+ // Only refresh the selected commit when the revision list has finished graphing
254
+ if (isBusy && !repository.revisionList .isUpdating ) {
255
+ if (selectedCommit && [repository commitForSHA: [selectedCommit sha ]])
256
+ [self selectCommit: [selectedCommit sha ]];
257
+ else if ([repository.currentBranch isSimpleRef ])
258
+ [self selectCommit: [repository shaForRef: [repository.currentBranch ref ]]];
259
+ else
260
+ [self selectCommit: [[self firstCommit ] sha ]];
261
+ }
262
+ [self updateStatus ];
263
+ }
264
+ else {
261
265
[super observeValueForKeyPath: keyPath ofObject: object change: change context: ctx];
262
266
}
263
267
@@ -408,9 +412,7 @@ - (void) updateQuicklookForce:(BOOL)force
408
412
409
413
- (IBAction ) refresh : (id )sender
410
414
{
411
- selectedCommitBeforeRefresh = selectedCommit;
412
415
[repository forceUpdateRevisions ];
413
- selectedCommitBeforeRefresh = NULL ;
414
416
}
415
417
416
418
- (void ) updateView
0 commit comments