Exemple #1
0
 public static void Fetch(this IRepository repository, IEnumerable <Remote> remotes, CredentialsHandler credentials, IEventStream?eventStream = null, bool prune = false)
 {
     foreach (var remote in remotes)
     {
         Git.Fetch(
             (Repository)repository,
             remote.Name,
             remote.FetchRefSpecs.Select(x => x.Specification), new FetchOptions
         {
             Prune = prune,
             CredentialsProvider = credentials,
             OnProgress          = serverProgressOutput =>
             {
                 eventStream?.Push(new Status(serverProgressOutput));
                 return(true);
             },
             OnTransferProgress = progress =>
             {
                 eventStream?.Push(new Status($"Received {progress.ReceivedObjects} of {progress.TotalObjects}", progress.ReceivedObjects / (float)progress.TotalObjects));
                 return(true);
             }
         }, string.Empty);
     }
 }
Exemple #2
0
 public static void Stage(this IRepository repository, string filepath) =>
 Git.Stage(repository, filepath);
Exemple #3
0
 public static void Remove(this IRepository repository, string filepath) =>
 Git.Remove(repository, filepath);
Exemple #4
0
 public static void Checkout(this IRepository repository, Branch branch) =>
 Git.Checkout(repository, branch);