public IObservable <TreeChanges> GetTreeChanges(ILocalRepositoryModel repository, IPullRequestModel pullRequest)
 {
     return(Observable.Defer(async() =>
     {
         var repo = gitService.GetRepository(repository.LocalPath);
         await gitClient.Fetch(repo, "origin");
         var changes = await gitClient.Compare(repo, pullRequest.Base.Sha, pullRequest.Head.Sha, detectRenames: true);
         return Observable.Return(changes);
     }));
 }
예제 #2
0
        /// <inheritdoc/>
        public async Task <IReadOnlyList <DiffChunk> > Diff(
            IRepository repo,
            string baseSha,
            string headSha,
            string path)
        {
            var patch = await gitClient.Compare(repo, baseSha, headSha, path);

            return(DiffUtilities.ParseFragment(patch).ToList());
        }
예제 #3
0
 public IObservable <TreeChanges> GetTreeChanges(ILocalRepositoryModel repository, IPullRequestModel pullRequest)
 {
     return(Observable.Defer(async() =>
     {
         // TreeChanges doesn't keep a reference to Repository
         using (var repo = gitService.GetRepository(repository.LocalPath))
         {
             var remote = await gitClient.GetHttpRemote(repo, "origin");
             await gitClient.Fetch(repo, remote.Name);
             var changes = await gitClient.Compare(repo, pullRequest.Base.Sha, pullRequest.Head.Sha, detectRenames: true);
             return Observable.Return(changes);
         }
     }));
 }