internal RepositoryStatus(Repository repository, RepositoryStatusOptions options, string singleFile, string rootDir, bool recursive) { Repository = repository; Options = options ?? new RepositoryStatusOptions { ForceContentCheck = true }; IgnoreHandler = new IgnoreHandler(Repository); _root_path = Repository.ToGitPath(rootDir); _recursive = recursive; _file_path = Repository.ToGitPath(singleFile); Update(); }
void WriteTree(ObjectWriter writer, Core.Tree headTree, GitIndex index, Core.Tree tree, DirectoryInfo dir) { foreach (var fsi in dir.GetFileSystemInfos()) { if (fsi is FileInfo) { // Exclude untracked files string gname = _repo.ToGitPath(fsi.FullName); bool inIndex = index.GetEntry(gname) != null; bool inHead = headTree.FindBlobMember(gname) != null; if (inIndex || inHead) { var entry = tree.AddFile(fsi.Name); entry.Id = writer.WriteBlob((FileInfo)fsi); } } else if (fsi.Name != Constants.DOT_GIT) { var child = tree.AddTree(fsi.Name); WriteTree(writer, headTree, index, child, (DirectoryInfo)fsi); child.Id = writer.WriteTree(child); } } }