}
File repository = GitUtils.getRootFile(context);
if (repository == null) {
return;
}
StatusCache cache = Git.getInstance().getStatusCache();
cache.refreshCached(context);
for (File root : context.getRootFiles()) {
if (isCanceled()) {
return;
}
if (root.isDirectory()) {
Map<File, StatusInfo> interestingFiles;
interestingFiles = GitCommand.getInterestingStatus(repository, root);
if (!interestingFiles.isEmpty()) {
Collection<File> files = interestingFiles.keySet();
Map<File, Map<File, StatusInfo>> interestingDirs =
GitUtils.getInterestingDirs(interestingFiles, files);
for (File file : files) {
if (isCanceled()) {
return;
}
StatusInfo fi = interestingFiles.get(file);
cache.refreshFileStatus(file, fi,
interestingDirs.get(file.isDirectory() ? file : file.getParentFile()));
}
}
} else {
cache.refresh(root, StatusCache.REPOSITORY_STATUS_UNKNOWN);
}
}
performAfter();
}