Exemple #1
0
 public GitFileSystem(GitFileSystemParams param) : base(param)
 {
     try
     {
         this.Commit = this.Repository.FindCommitAsync(param.CommitId)._GetResult();
     }
     catch (Exception ex)
     {
         this._DisposeSafe(ex);
         throw;
     }
 }
Exemple #2
0
        public Task <GitCommit> FindCommitAsync(string commitId, CancellationToken cancel = default)
        {
            return(this.RunCriticalProcessAsync(true, cancel, c =>
            {
                ObjectId objId = new ObjectId(commitId);

                Commit commit = this.Repository.Lookup <Commit>(objId);

                if (commit == null)
                {
                    throw new ArgumentException($"Commit \"{objId.Sha}\" not found.");
                }

                GitCommit ret = new GitCommit(this, commit);

                return Task.FromResult(ret);
            }));
        }