<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -417,28 +417,28 @@ NSString *PBGitIndexOperationFailed = @&quot;PBGitIndexOperationFailed&quot;;
 	NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; 
 
 	// Other files (not tracked, not ignored)
+	refreshStatus++;
 	NSFileHandle *handle = [PBEasyPipe handleForCommand:[PBGitBinary path] 
 											   withArgs:[NSArray arrayWithObjects:@&quot;ls-files&quot;, @&quot;--others&quot;, @&quot;--exclude-standard&quot;, @&quot;-z&quot;, 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:@&quot;diff-files&quot;, @&quot;-z&quot;, 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:@&quot;diff-index&quot;, @&quot;--cached&quot;, @&quot;-z&quot;, [self parentTree], nil]
 									inDir:[workingDirectory path]];
 	[nc addObserver:self selector:@selector(readStagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; 
 	[handle readToEndOfFileInBackgroundAndNotify];
-	refreshStatus++;
 }
 
 - (void)readOtherFiles:(NSNotification *)notification</diff>
      <filename>PBGitIndex.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ce89e0f4684d4c6eea1fd87e99bfe8b9560344e5</id>
    </parent>
  </parents>
  <author>
    <name>Pieter de Bie</name>
    <email>pdebie@ai.rug.nl</email>
  </author>
  <url>http://github.com/pieter/gitx/commit/5be8aed2b75b428139a4aaefe4b0b89439c07e66</url>
  <id>5be8aed2b75b428139a4aaefe4b0b89439c07e66</id>
  <committed-date>2009-10-01T12:17:32-07:00</committed-date>
  <authored-date>2009-10-01T12:17:32-07:00</authored-date>
  <message>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.</message>
  <tree>06d73ccfd58e981e921b982d164989e947d291bc</tree>
  <committer>
    <name>Pieter de Bie</name>
    <email>pdebie@ai.rug.nl</email>
  </committer>
</commit>
