public GitFileStatus GetFileStatusNoCache(string fileName) { //Debug.WriteLine(string.Format("===+ GetFileStatusNoCache {0}", fileName)); var fileNameRel = GetRelativeFileNameForGit(fileName); IndexDiff indexDiff = new IndexDiff(repository, Constants.HEAD, new FileTreeIterator(repository)); indexDiff.SetFilter(PathFilterGroup.CreateFromStrings(fileNameRel)); indexDiff.Diff(); if (indexDiff.GetModified().Count > 0) return GitFileStatus.Modified; if (indexDiff.GetConflicting().Count > 0) return GitFileStatus.Conflict; if (indexDiff.GetUntracked().Count > 0 || indexDiff.GetUntrackedFolders().Count > 0) { if (File.Exists(fileName)) return GitFileStatus.New; return GitFileStatus.NotControlled; } if (indexDiff.GetAdded().Count > 0) return GitFileStatus.Added; if (!File.Exists(fileName)) { if (indexDiff.GetMissing().Count > 0) return GitFileStatus.Removed; return GitFileStatus.Deleted; } if (indexDiff.GetChanged().Count > 0) return GitFileStatus.Staged; if (indexDiff.GetIgnoredNotInIndex().Count > 0) return GitFileStatus.Ignored; return GitFileStatus.Tracked; }