anchor.diff:           }
   
            if (entry.isDirectory) {
  -           return walkFilesAndUpdateIndex(entry as chrome.DirectoryEntry)
  -               .then((List<String> paths) {
  +           return walkFilesAndUpdateIndex(entry as chrome.DirectoryEntry,
  +               updateSha).then((List<String> paths) {
                filePaths.addAll(paths);
                return filePaths;
              });
            } else {
              // don't update index for untracked files.
              if (_statusIdx[entry.fullPath] != null) {
  -             return getShaForEntry(entry, 'blob').then((String sha) {
  -               return entry.getMetadata().then((data) {
  -                 FileStatus status = new FileStatus();
  -                 status.path = entry.fullPath;
  -                 status.sha = sha;
  -                 status.size = data.size;
  -                 updateIndexForEntry(status);
  -                 filePaths.add(entry.fullPath);
  +             filePaths.add(entry.fullPath);
  +             if (updateSha) {
  +               return getShaForEntry(entry, 'blob').then((String sha) {
  +                 return entry.getMetadata().then((data) {
  +                   FileStatus status = new FileStatus();
  +                   status.path = entry.fullPath;
  +                   status.sha = sha;
  +                   status.size = data.size;
  +                   updateIndexForEntry(status);
  +                 });
                  });
  -             });
  +             }
              }
            }
         }).then((_) {
  
positive.code:   }
  
    void updateIndexForEntry(FileStatus status) {
  
      // Don't track index for git files.
      if (status.path != null && status.path.contains('.git')) {
        return;
      }
  
      FileStatus oldStatus = _statusIdx[status.path];
  
  
negative.code:       _scheduleWriteIndex();
    }
  
    Future updateIndex([bool updateSha=true]) {
      return walkFilesAndUpdateIndex(_store.root, updateSha).then(
          (List<String> filePaths) {
        _updateDeletedFiles(filePaths);
        return new Future.value();
      });
  