public static GitStatus GetFileStatus(string fileName) { string wcroot = Git.FindWorkingCopyRoot(fileName); if (wcroot == null) { return(GitStatus.None); } GitStatusSet gss = GetStatusSet(wcroot); return(gss.GetStatus(Git.AdaptFileNameNoQuotes(wcroot, fileName))); }
public BaseVersionChangeWatcher(FileName fileName, string hash, EventHandler callback) { string root = Git.FindWorkingCopyRoot(fileName); if (root == null) { throw new InvalidOperationException(fileName + " must be under version control!"); } this.callback = callback; this.fileName = fileName; this.hash = hash; watcher = RepoChangeWatcher.AddWatch(Path.Combine(root, ".git"), HandleChanges); }