Skip to content

Commit 2cdf2b6

Browse files
committed
Merge branch 'pu/pb/index_quick_fix' into stable
* pu/pb/index_quick_fix: CommitView: Don't keep rearranging when iterating over files IndexController: de-privatize the index-stopping stuff
2 parents 3324591 + 00731eb commit 2cdf2b6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

PBGitCommitController.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import "PBChangedFile.h"
1212
#import "PBWebChangesController.h"
1313
#import "NSString_RegEx.h"
14-
14+
#import "PBGitIndexController.h"
1515

1616
@interface PBGitCommitController (PrivateMethods)
1717
- (NSArray *) linesFromNotification:(NSNotification *)notification;
@@ -240,6 +240,7 @@ - (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines
240240
- (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)staged tracked:(BOOL)tracked
241241
{
242242
// Iterate over all existing files
243+
[indexController stopTrackingIndex];
243244
for (PBChangedFile *file in files) {
244245
NSArray *fileStatus = [dictionary objectForKey:file.path];
245246
// Object found, this is still a cached / uncached thing
@@ -270,6 +271,7 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)s
270271
file.hasUnstagedChanges = NO;
271272
}
272273
}
274+
[indexController resumeTrackingIndex];
273275

274276
// Do new files
275277
if (![[dictionary allKeys] count])

PBGitIndexController.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@
3636
- (NSString *) stagedChangesForFile:(PBChangedFile *)file;
3737
- (NSString *) unstagedChangesForFile:(PBChangedFile *)file;
3838

39+
- (void)stopTrackingIndex;
40+
- (void)resumeTrackingIndex;
41+
3942
- (NSMenu *) menuForTable:(NSTableView *)table;
4043
@end

PBGitIndexController.m

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212

1313
#define FileChangesTableViewType @"GitFileChangedType"
1414

15-
@interface PBGitIndexController (PrivateMethods)
16-
- (void)stopTrackingIndex;
17-
- (void)resumeTrackingIndex;
18-
@end
19-
2015
@implementation PBGitIndexController
2116

2217
@synthesize contextSize;

0 commit comments

Comments
 (0)