diff --git a/Classes/Controllers/PBGitHistoryController.m b/Classes/Controllers/PBGitHistoryController.m index a26f6ddc5..54b097dd4 100644 --- a/Classes/Controllers/PBGitHistoryController.m +++ b/Classes/Controllers/PBGitHistoryController.m @@ -180,11 +180,10 @@ - (void) _repositoryUpdatedNotification:(NSNotification *)notification { - (void)reselectCommitAfterUpdate { [self updateStatus]; - if ([self.repository.currentBranch isSimpleRef]) { - [self selectCommit:[self.repository OIDForRef:self.repository.currentBranch.ref] withRescroll:NO]; - } else { - [self selectCommit:self.firstCommit.OID withRescroll:NO]; - } + if ([self.repository.currentBranch isSimpleRef]) + [self selectCommit:[self.repository OIDForRef:self.repository.currentBranch.ref]]; + else + [self selectCommit:self.firstCommit.OID]; } - (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row { @@ -552,11 +551,6 @@ - (NSArray *) selectedObjectsForOID:(GTOID *)commitOID } - (void)selectCommit:(GTOID *)commitOID -{ - [self selectCommit:commitOID withRescroll:YES]; -} - -- (void)selectCommit:(GTOID *)commitOID withRescroll:(BOOL)doRescroll { if (!forceSelectionUpdate && [[[commitController.selectedObjects lastObject] OID] isEqual:commitOID]) { return; @@ -565,10 +559,8 @@ - (void)selectCommit:(GTOID *)commitOID withRescroll:(BOOL)doRescroll NSArray *selectedObjects = [self selectedObjectsForOID:commitOID]; [commitController setSelectedObjects:selectedObjects]; - if (doRescroll) { - NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; - [self scrollSelectionToTopOfViewFrom:oldIndex]; - } + NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; + [self scrollSelectionToTopOfViewFrom:oldIndex]; forceSelectionUpdate = NO; }