コード例 #1
0
 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();
 }
コード例 #2
0
 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);
         }
     }
 }