Exemple #1
0
 static int StageChanges(Repository repo)
 {
     try
     {
         RepositoryStatus status = repo.RetrieveStatus();
         //List<string> filePaths = status.Modified.Select(mods => mods.FilePath).ToList();
         List <string> filePaths = status.Select(mods => mods.FilePath).ToList();
         if (filePaths.Count == 0)
         {
             return(0);
         }
         Commands.Stage(repo, filePaths);
         return(filePaths.Count);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception:RepoActions:StageChanges " + ex.Message);
         return(0);
     }
 }
Exemple #2
0
 public GitRepoStatus(RepositoryStatus status)
 {
     entries.AddRange(status.Select(e => new GitStatusEntry(e.FilePath, e.State)));
 }