mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
GitIndex: increase refreshStatus before launching task
We used to increase this variable after handing it over to the [handle readToEndOfFileInBackgroundAndNotify], but sometimes a task would quit before getting to that point, causing a premature index refresh event to be called.
This commit is contained in:
+3
-3
@@ -417,28 +417,28 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
// Other files (not tracked, not ignored)
|
||||
refreshStatus++;
|
||||
NSFileHandle *handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
|
||||
withArgs:[NSArray arrayWithObjects:@"ls-files", @"--others", @"--exclude-standard", @"-z", nil]
|
||||
inDir:[workingDirectory path]];
|
||||
[nc addObserver:self selector:@selector(readOtherFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
|
||||
[handle readToEndOfFileInBackgroundAndNotify];
|
||||
refreshStatus++;
|
||||
|
||||
// Unstaged files
|
||||
refreshStatus++;
|
||||
handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
|
||||
withArgs:[NSArray arrayWithObjects:@"diff-files", @"-z", nil]
|
||||
inDir:[workingDirectory path]];
|
||||
[nc addObserver:self selector:@selector(readUnstagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
|
||||
[handle readToEndOfFileInBackgroundAndNotify];
|
||||
refreshStatus++;
|
||||
|
||||
// Staged files
|
||||
refreshStatus++;
|
||||
handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
|
||||
withArgs:[NSArray arrayWithObjects:@"diff-index", @"--cached", @"-z", [self parentTree], nil]
|
||||
inDir:[workingDirectory path]];
|
||||
[nc addObserver:self selector:@selector(readStagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
|
||||
[handle readToEndOfFileInBackgroundAndNotify];
|
||||
refreshStatus++;
|
||||
}
|
||||
|
||||
- (void)readOtherFiles:(NSNotification *)notification
|
||||
|
||||
Reference in New Issue
Block a user