Skip to content

Commit ad2213c

Browse files
committed
CommitController: Notify observers when adding files
We forgot to do this when changing the code in 963969a (CommitController: don't mutate array we enumerate when refreshing index). This meant that some changes in the index would not be shown when refreshing, for example newly added or changed files.
1 parent 4391c45 commit ad2213c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

PBGitCommitController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)s
264264
}
265265

266266
// Do new files
267+
if (![[dictionary allKeys] count])
268+
return;
269+
270+
[self willChangeValueForKey:@"files"];
267271
for (NSString *path in [dictionary allKeys]) {
268272
NSArray *fileStatus = [dictionary objectForKey:path];
269273

@@ -285,6 +289,7 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)s
285289

286290
[files addObject: file];
287291
}
292+
[self didChangeValueForKey:@"files"];
288293
}
289294

290295
- (void) readUnstagedFiles:(NSNotification *)notification

0 commit comments

Comments
 (0)