From 916711324f4b04b1538f6af06b1f4ae85faf2927 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sat, 12 Sep 2009 23:43:14 +0200 Subject: [PATCH 1/2] IndexController: de-privatize the index-stopping stuff We shouldn't need to do this, but we still need to, because our index operations are split between two different controllers, which is a bit odd. --- PBGitIndexController.h | 3 +++ PBGitIndexController.m | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PBGitIndexController.h b/PBGitIndexController.h index a3bc191..184d670 100644 --- a/PBGitIndexController.h +++ b/PBGitIndexController.h @@ -36,5 +36,8 @@ - (NSString *) stagedChangesForFile:(PBChangedFile *)file; - (NSString *) unstagedChangesForFile:(PBChangedFile *)file; +- (void)stopTrackingIndex; +- (void)resumeTrackingIndex; + - (NSMenu *) menuForTable:(NSTableView *)table; @end diff --git a/PBGitIndexController.m b/PBGitIndexController.m index 21c7076..6645ca1 100644 --- a/PBGitIndexController.m +++ b/PBGitIndexController.m @@ -12,11 +12,6 @@ #define FileChangesTableViewType @"GitFileChangedType" -@interface PBGitIndexController (PrivateMethods) -- (void)stopTrackingIndex; -- (void)resumeTrackingIndex; -@end - @implementation PBGitIndexController @synthesize contextSize; From 00731eb285650df15befdda83ffccecd73012324 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sat, 12 Sep 2009 23:43:35 +0200 Subject: [PATCH 2/2] CommitView: Don't keep rearranging when iterating over files --- PBGitCommitController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 1e894ee..3f156aa 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -11,7 +11,7 @@ #import "PBChangedFile.h" #import "PBWebChangesController.h" #import "NSString_RegEx.h" - +#import "PBGitIndexController.h" @interface PBGitCommitController (PrivateMethods) - (NSArray *) linesFromNotification:(NSNotification *)notification; @@ -240,6 +240,7 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)staged tracked:(BOOL)tracked { // Iterate over all existing files + [indexController stopTrackingIndex]; for (PBChangedFile *file in files) { NSArray *fileStatus = [dictionary objectForKey:file.path]; // Object found, this is still a cached / uncached thing @@ -270,6 +271,7 @@ file.hasUnstagedChanges = NO; } } + [indexController resumeTrackingIndex]; // Do new files if (![[dictionary allKeys] count])