diff --git a/NGitLab.Mock/Clients/CommitClient.cs b/NGitLab.Mock/Clients/CommitClient.cs index 1ed108ad..f8e40e5f 100644 --- a/NGitLab.Mock/Clients/CommitClient.cs +++ b/NGitLab.Mock/Clients/CommitClient.cs @@ -1,5 +1,7 @@ using System; using System.Linq; +using System.Threading.Tasks; +using System.Threading; using NGitLab.Mock.Internals; using NGitLab.Models; @@ -37,6 +39,12 @@ public Commit GetCommit(string @ref) } } + public async Task GetCommitAsync(string @ref, CancellationToken cancellationToken = default) + { + await Task.Yield(); + return GetCommit(@ref); + } + public Commit CherryPick(CommitCherryPick cherryPick) { using (Context.BeginOperationScope()) diff --git a/NGitLab.Mock/Clients/RepositoryClient.cs b/NGitLab.Mock/Clients/RepositoryClient.cs index 9fc52d8b..d5f65199 100644 --- a/NGitLab.Mock/Clients/RepositoryClient.cs +++ b/NGitLab.Mock/Clients/RepositoryClient.cs @@ -2,6 +2,9 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; using NGitLab.Mock.Internals; using NGitLab.Models; @@ -107,16 +110,40 @@ public IEnumerable GetCommits(GetCommitsRequest request) } } + public async IAsyncEnumerable GetCommitsAsync(GetCommitsRequest request, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + await Task.Yield(); + + using (Context.BeginOperationScope()) + { + var project = GetProject(_projectId, ProjectPermission.View); + foreach (var commit in project.Repository.GetCommits(request)) + { + yield return ConvertToNGitLabCommit(commit, project); + } + } + } + public Commit GetCommit(Sha1 sha) { throw new NotImplementedException(); } + public Task GetCommitAsync(Sha1 sha, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + public IEnumerable GetCommitDiff(Sha1 sha) { throw new NotImplementedException(); } + public IAsyncEnumerable GetCommitDiffAsync(Sha1 sha, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + public IEnumerable GetCommitRefs(Sha1 sha, CommitRefType type = CommitRefType.All) { throw new NotImplementedException(); diff --git a/NGitLab.Tests/CommitsTests.cs b/NGitLab.Tests/CommitsTests.cs index 2e4ebda4..67a7d7c4 100644 --- a/NGitLab.Tests/CommitsTests.cs +++ b/NGitLab.Tests/CommitsTests.cs @@ -23,6 +23,18 @@ public async Task Test_can_get_commit() Assert.That(commit.ShortId, Is.Not.Null); } + [Test] + [NGitLabRetry] + public async Task Test_can_get_commit_async() + { + using var context = await GitLabTestContext.CreateAsync(); + var project = context.CreateProject(initializeWithCommits: true); + + var commit = await context.Client.GetCommits(project.Id).GetCommitAsync(project.DefaultBranch); + Assert.That(commit.Message, Is.Not.Null); + Assert.That(commit.ShortId, Is.Not.Null); + } + [Test] [NGitLabRetry] public async Task Test_can_get_stats_in_commit() @@ -51,6 +63,34 @@ public async Task Test_can_get_stats_in_commit() Assert.That(commit.Stats.Total, Is.EqualTo(5)); } + [Test] + [NGitLabRetry] + public async Task Test_can_get_stats_in_commit_async() + { + using var context = await GitLabTestContext.CreateAsync(); + var project = context.CreateProject(initializeWithCommits: true); + context.Client.GetRepository(project.Id).Files.Create(new FileUpsert + { + Branch = project.DefaultBranch, + CommitMessage = "file to be updated", + Path = "CommitStats.txt", + RawContent = "I'm defective and i need to be fixeddddddddddddddd", + }); + + context.Client.GetRepository(project.Id).Files.Update(new FileUpsert + { + Branch = project.DefaultBranch, + CommitMessage = "fixing the file", + Path = "CommitStats.txt", + RawContent = "I'm no longer defective and i have been fixed\n\n\r\n\r\rEnjoy", + }); + + var commit = await context.Client.GetCommits(project.Id).GetCommitAsync(project.DefaultBranch); + Assert.That(commit.Stats.Additions, Is.EqualTo(4)); + Assert.That(commit.Stats.Deletions, Is.EqualTo(1)); + Assert.That(commit.Stats.Total, Is.EqualTo(5)); + } + [Test] [NGitLabRetry] public async Task Test_can_get_merge_request_associated_to_commit() diff --git a/NGitLab.Tests/RepositoryClient/RepositoryClientTests.cs b/NGitLab.Tests/RepositoryClient/RepositoryClientTests.cs index 5f8d5204..809e9cc7 100644 --- a/NGitLab.Tests/RepositoryClient/RepositoryClientTests.cs +++ b/NGitLab.Tests/RepositoryClient/RepositoryClientTests.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Formats.Tar; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Threading.Tasks; +using System.Web; using NGitLab.Models; using NGitLab.Tests.Docker; using NUnit.Framework; @@ -56,6 +58,20 @@ public async Task GetCommitBySha1() Assert.That(commit.WebUrl, Is.Not.Null); } + [Test] + [NGitLabRetry] + public async Task GetCommitBySha1Async() + { + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 2); + + var sha1 = context.Commits[0].Id; + var commit = await context.RepositoryClient.GetCommitAsync(sha1); + Assert.That(commit.Id, Is.EqualTo(sha1)); + Assert.That(commit.Message, Is.EqualTo(context.Commits[0].Message)); + Assert.That(commit.WebUrl, Is.EqualTo(context.Commits[0].WebUrl)); + Assert.That(commit.WebUrl, Is.Not.Null); + } + [Test] [NGitLabRetry] public async Task GetCommitBySha1Range() @@ -74,6 +90,28 @@ public async Task GetCommitBySha1Range() Assert.That(commits[1].Id, Is.EqualTo(allCommits[3].Id)); } + [Test] + [NGitLabRetry] + public async Task GetCommitBySha1RangeAsync() + { + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var allCommits = context.RepositoryClient.Commits.Reverse().ToArray(); + var commitRequest = new GetCommitsRequest + { + RefName = $"{allCommits[1].Id}..{allCommits[3].Id}", + FirstParent = true, + }; + + List commits = new(); + await foreach(var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)){ + commits.Add(commit); + } + commits.Reverse(); + Assert.That(commits[0].Id, Is.EqualTo(allCommits[2].Id)); + Assert.That(commits[1].Id, Is.EqualTo(allCommits[3].Id)); + } + [Test] [NGitLabRetry] public async Task GetCommitsSince() @@ -99,6 +137,35 @@ public async Task GetCommitsSince() Assert.That(lastRequestQueryString, Does.Contain($"since={expectedSinceValue}")); } + [Test] + [NGitLabRetry] + public async Task GetCommitsSinceAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var since = DateTime.UtcNow; + var expectedSinceValue = Uri.EscapeDataString(since.ToString("s", CultureInfo.InvariantCulture)); + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Since = since, + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + + Assert.That(lastRequestQueryString, Does.Contain($"since={expectedSinceValue}")); + } + [Test] [NGitLabRetry] public async Task GetCommitsDoesntIncludeSinceWhenNotSpecified() @@ -122,6 +189,33 @@ public async Task GetCommitsDoesntIncludeSinceWhenNotSpecified() Assert.That(lastRequestQueryString, Does.Not.Contain("since=")); } + [Test] + [NGitLabRetry] + public async Task GetCommitsDoesntIncludeSinceWhenNotSpecifiedAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Since = null, + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + + Assert.That(lastRequestQueryString, Does.Not.Contain("since=")); + } + [Test] [NGitLabRetry] public async Task GetCommitsUntil() @@ -147,6 +241,35 @@ public async Task GetCommitsUntil() Assert.That(lastRequestQueryString, Does.Contain($"until={expectedUntilValue}")); } + [Test] + [NGitLabRetry] + public async Task GetCommitsUntilAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var until = DateTime.UtcNow; + var expectedUntilValue = Uri.EscapeDataString(until.ToString("s", CultureInfo.InvariantCulture)); + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Until = until, + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + + Assert.That(lastRequestQueryString, Does.Contain($"until={expectedUntilValue}")); + } + [Test] [NGitLabRetry] public async Task GetCommitsDoesntIncludeUntilWhenNotSpecified() @@ -170,6 +293,178 @@ public async Task GetCommitsDoesntIncludeUntilWhenNotSpecified() Assert.That(lastRequestQueryString, Does.Not.Contain("until=")); } + [Test] + [NGitLabRetry] + public async Task GetCommitsDoesntIncludeUntilWhenNotSpecifiedAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Until = null, + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + + Assert.That(lastRequestQueryString, Does.Not.Contain("until=")); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsDoesntIncludePageWhenNotSpecified() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Page = null, + }; + + // Act + var commits = context.RepositoryClient.GetCommits(commitRequest).ToArray(); + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + + NameValueCollection queryParameters = HttpUtility.ParseQueryString(lastRequestQueryString); + Assert.That(queryParameters, Does.Not.Contain("page")); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsDoesntIncludePageWhenNotSpecifiedAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Page = null, + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + var lastRequestQueryString = context.Context.LastRequest.RequestUri.Query; + NameValueCollection queryParameters = HttpUtility.ParseQueryString(lastRequestQueryString); + Assert.That(queryParameters, Does.Not.Contain("page")); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsRetrievesPageWhenSpecified() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Page = 1, + PerPage = 2 + }; + + // Act + var commits = context.RepositoryClient.GetCommits(commitRequest).ToArray(); + + // Assert + Assert.That(commits.Length, Is.EqualTo(2)); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsRetrievesPageWhenSpecifiedAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + Page = 1, + PerPage = 2 + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + Assert.That(commits.Count, Is.EqualTo(2)); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsRetrievesAllPagesWhenNoPageSpecified() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + PerPage = 2 + }; + + // Act + var commits = context.RepositoryClient.GetCommits(commitRequest).ToArray(); + + // Assert + Assert.That(commits.Length, Is.EqualTo(5)); + } + + [Test] + [NGitLabRetry] + public async Task GetCommitsRetrievesAllPagesWhenNoPageSpecifiedAsync() + { + // Arrange + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 5); + + var defaultBranch = context.Project.DefaultBranch; + var commitRequest = new GetCommitsRequest + { + RefName = defaultBranch, + PerPage = 2 + }; + + // Act + List commits = new(); + await foreach (var commit in context.RepositoryClient.GetCommitsAsync(commitRequest)) + { + commits.Add(commit); + } + + // Assert + Assert.That(commits.Count, Is.EqualTo(5)); + } + [Test] [NGitLabRetry] public async Task GetCommitDiff() @@ -179,6 +474,20 @@ public async Task GetCommitDiff() Assert.That(context.RepositoryClient.GetCommitDiff(context.RepositoryClient.Commits.First().Id).ToArray(), Is.Not.Empty); } + [Test] + [NGitLabRetry] + public async Task GetCommitDiffAsync() + { + using var context = await RepositoryClientTestsContext.CreateAsync(commitCount: 2); + var commitDiffs = new List(); + + await foreach (var commitDiff in context.RepositoryClient.GetCommitDiffAsync(context.RepositoryClient.Commits.First().Id)) + { + commitDiffs.Add(commitDiff); + } + Assert.That(commitDiffs, Is.Not.Empty); + } + [TestCase(4)] [TestCase(11)] [NGitLabRetry] diff --git a/NGitLab/GetCommitsRequest.cs b/NGitLab/GetCommitsRequest.cs index 459591a8..58fd3eeb 100644 --- a/NGitLab/GetCommitsRequest.cs +++ b/NGitLab/GetCommitsRequest.cs @@ -16,6 +16,8 @@ public class GetCommitsRequest public uint PerPage { get; set; } = DefaultPerPage; + public uint? Page { get; set; } + public DateTime? Since { get; set; } public DateTime? Until { get; set; } diff --git a/NGitLab/ICommitClient.cs b/NGitLab/ICommitClient.cs index 7f290df1..2ca9c671 100644 --- a/NGitLab/ICommitClient.cs +++ b/NGitLab/ICommitClient.cs @@ -1,4 +1,6 @@ using System; +using System.Threading.Tasks; +using System.Threading; using NGitLab.Models; namespace NGitLab; @@ -22,6 +24,11 @@ public interface ICommitClient /// Commit GetCommit(string @ref); + /// + /// Get a specific commit identified by the commit hash or name of a branch or tag. + /// + Task GetCommitAsync(string @ref, CancellationToken cancellationToken = default); + /// /// Cherry-picks a commit to a given branch. /// diff --git a/NGitLab/IRepositoryClient.cs b/NGitLab/IRepositoryClient.cs index 1734ff8a..5f0eb718 100644 --- a/NGitLab/IRepositoryClient.cs +++ b/NGitLab/IRepositoryClient.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.IO; +using System.Threading; +using System.Threading.Tasks; using NGitLab.Models; namespace NGitLab; @@ -37,10 +39,16 @@ public interface IRepositoryClient /// IEnumerable GetCommits(GetCommitsRequest request); + IAsyncEnumerable GetCommitsAsync(GetCommitsRequest request, CancellationToken cancellationToken = default); + Commit GetCommit(Sha1 sha); + Task GetCommitAsync(Sha1 sha, CancellationToken cancellationToken = default); + IEnumerable GetCommitDiff(Sha1 sha); + IAsyncEnumerable GetCommitDiffAsync(Sha1 sha, CancellationToken cancellationToken = default); + IEnumerable GetCommitRefs(Sha1 sha, CommitRefType type = CommitRefType.All); IFilesClient Files { get; } diff --git a/NGitLab/Impl/CommitClient.cs b/NGitLab/Impl/CommitClient.cs index 1e37eeb0..421f508d 100644 --- a/NGitLab/Impl/CommitClient.cs +++ b/NGitLab/Impl/CommitClient.cs @@ -1,6 +1,8 @@ using System; using System.ComponentModel; using System.Net; +using System.Threading; +using System.Threading.Tasks; using NGitLab.Models; namespace NGitLab.Impl; @@ -27,6 +29,11 @@ public Commit GetCommit(string @ref) { return _api.Get().To(_repoPath + $"/commits/{@ref}"); } + + public Task GetCommitAsync(string @ref, CancellationToken cancellationToken = default) + { + return _api.Get().ToAsync(_repoPath + $"/commits/{@ref}", cancellationToken); + } public Commit CherryPick(CommitCherryPick cherryPick) { diff --git a/NGitLab/Impl/HttpRequestor.cs b/NGitLab/Impl/HttpRequestor.cs index aaf1f874..92e7813f 100644 --- a/NGitLab/Impl/HttpRequestor.cs +++ b/NGitLab/Impl/HttpRequestor.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.IO; using System.Linq; using System.Net; using System.Threading; using System.Threading.Tasks; +using System.Web; using NGitLab.Impl.Json; using NGitLab.Models; @@ -212,8 +214,9 @@ public override async IAsyncEnumerator GetAsyncEnumerator(CancellationToken c var request = new GitLabRequest(nextUrlToLoad, MethodType.Get, data: null, _apiToken, _options); using (var response = await request.GetResponseAsync(_options, cancellationToken).ConfigureAwait(false)) { - nextUrlToLoad = GetNextPageUrl(response); - + NameValueCollection queryParameters = HttpUtility.ParseQueryString(_startUrl.Query); + nextUrlToLoad = queryParameters["page"] is null ? GetNextPageUrl(response) : null; + using var stream = response.GetResponseStream(); responseText = await ReadTextAsync(stream).ConfigureAwait(false); } @@ -233,8 +236,9 @@ public override IEnumerator GetEnumerator() var request = new GitLabRequest(nextUrlToLoad, MethodType.Get, data: null, _apiToken, _options); using (var response = request.GetResponse(_options)) { - nextUrlToLoad = GetNextPageUrl(response); - + NameValueCollection queryParameters = HttpUtility.ParseQueryString(_startUrl.Query); + nextUrlToLoad = queryParameters["page"] is null? GetNextPageUrl(response) : null; + using var stream = response.GetResponseStream(); responseText = ReadText(stream); } diff --git a/NGitLab/Impl/RepositoryClient.cs b/NGitLab/Impl/RepositoryClient.cs index 71b84a91..5fadf13d 100644 --- a/NGitLab/Impl/RepositoryClient.cs +++ b/NGitLab/Impl/RepositoryClient.cs @@ -4,6 +4,9 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; using NGitLab.Extensions; using NGitLab.Models; @@ -74,6 +77,29 @@ public IEnumerable GetCommits(string refName, int maxResults = 0) /// Gets all the commits of the specified branch/tag. /// public IEnumerable GetCommits(GetCommitsRequest request) + { + var path = BuildGetCommitsPath(request); + var allCommits = _api.Get().GetAll(path); + if (request.MaxResults <= 0) + return allCommits; + + return allCommits.Take(request.MaxResults); + } + + public async IAsyncEnumerable GetCommitsAsync(GetCommitsRequest request, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + var path = BuildGetCommitsPath(request); + int count = 0; + await foreach (var t in _api.Get().GetAllAsync(path).WithCancellation(cancellationToken).ConfigureAwait(false)) + { + count++; + yield return t; + if (count == request.MaxResults) + break; + } + } + + private string BuildGetCommitsPath(GetCommitsRequest request) { var lst = new List(); if (!string.IsNullOrWhiteSpace(request.RefName)) @@ -101,15 +127,16 @@ public IEnumerable GetCommits(GetCommitsRequest request) lst.Add($"until={Uri.EscapeDataString(request.Until.Value.ToString("s", CultureInfo.InvariantCulture))}"); } + if (request.Page.HasValue) + { + lst.Add($"page={request.Page.Value.ToStringInvariant()}"); + } + var perPage = request.MaxResults > 0 ? Math.Min(request.MaxResults, request.PerPage) : request.PerPage; lst.Add($"per_page={perPage.ToStringInvariant()}"); var path = _repoPath + "/commits" + (lst.Count == 0 ? string.Empty : "?" + string.Join("&", lst)); - var allCommits = _api.Get().GetAll(path); - if (request.MaxResults <= 0) - return allCommits; - - return allCommits.Take(request.MaxResults); + return path; } public CompareResults Compare(CompareQuery query) @@ -119,8 +146,12 @@ public CompareResults Compare(CompareQuery query) public Commit GetCommit(Sha1 sha) => _api.Get().To(_repoPath + "/commits/" + sha); + public Task GetCommitAsync(Sha1 sha, CancellationToken cancellationToken = default) => _api.Get().ToAsync(_repoPath + "/commits/" + sha, cancellationToken); + public IEnumerable GetCommitDiff(Sha1 sha) => _api.Get().GetAll(_repoPath + "/commits/" + sha + "/diff"); + public IAsyncEnumerable GetCommitDiffAsync(Sha1 sha, CancellationToken cancellationToken = default ) => _api.Get().GetAllAsync(_repoPath + "/commits/" + sha + "/diff"); + public IEnumerable GetCommitRefs(Sha1 sha, CommitRefType type = CommitRefType.All) => _api.Get().GetAll($"{_repoPath}/commits/{sha}/refs?type={type.ToString().ToLowerInvariant()}"); diff --git a/NGitLab/PublicAPI.Unshipped.txt b/NGitLab/PublicAPI.Unshipped.txt index a29e775c..89100378 100644 --- a/NGitLab/PublicAPI.Unshipped.txt +++ b/NGitLab/PublicAPI.Unshipped.txt @@ -34,6 +34,8 @@ NGitLab.GetCommitsRequest.FirstParent.set -> void NGitLab.GetCommitsRequest.GetCommitsRequest() -> void NGitLab.GetCommitsRequest.MaxResults.get -> int NGitLab.GetCommitsRequest.MaxResults.set -> void +NGitLab.GetCommitsRequest.Page.get -> uint? +NGitLab.GetCommitsRequest.Page.set -> void NGitLab.GetCommitsRequest.Path.get -> string NGitLab.GetCommitsRequest.Path.set -> void NGitLab.GetCommitsRequest.PerPage.get -> uint @@ -152,6 +154,7 @@ NGitLab.ICommitClient NGitLab.ICommitClient.CherryPick(NGitLab.Models.CommitCherryPick cherryPick) -> NGitLab.Models.Commit NGitLab.ICommitClient.Create(NGitLab.Models.CommitCreate commit) -> NGitLab.Models.Commit NGitLab.ICommitClient.GetCommit(string ref) -> NGitLab.Models.Commit +NGitLab.ICommitClient.GetCommitAsync(string ref, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task NGitLab.ICommitClient.GetJobStatus(string branchName) -> NGitLab.JobStatus NGitLab.ICommitClient.GetRelatedMergeRequestsAsync(NGitLab.Models.RelatedMergeRequestsQuery query) -> NGitLab.GitLabCollectionResponse NGitLab.ICommitStatusClient @@ -519,6 +522,7 @@ NGitLab.Impl.CommitClient.CommitClient(NGitLab.Impl.API api, int projectId) -> v NGitLab.Impl.CommitClient.CommitClient(NGitLab.Impl.API api, NGitLab.Models.ProjectId projectId) -> void NGitLab.Impl.CommitClient.Create(NGitLab.Models.CommitCreate commit) -> NGitLab.Models.Commit NGitLab.Impl.CommitClient.GetCommit(string ref) -> NGitLab.Models.Commit +NGitLab.Impl.CommitClient.GetCommitAsync(string ref, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task NGitLab.Impl.CommitClient.GetJobStatus(string branchName) -> NGitLab.JobStatus NGitLab.Impl.CommitClient.GetRelatedMergeRequestsAsync(NGitLab.Models.RelatedMergeRequestsQuery query) -> NGitLab.GitLabCollectionResponse NGitLab.Impl.CommitStatusClient @@ -910,10 +914,13 @@ NGitLab.Impl.RepositoryClient.Contributors.get -> NGitLab.IContributorClient NGitLab.Impl.RepositoryClient.Files.get -> NGitLab.IFilesClient NGitLab.Impl.RepositoryClient.GetArchive(System.Action parser) -> void NGitLab.Impl.RepositoryClient.GetCommit(NGitLab.Sha1 sha) -> NGitLab.Models.Commit +NGitLab.Impl.RepositoryClient.GetCommitAsync(NGitLab.Sha1 sha, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task NGitLab.Impl.RepositoryClient.GetCommitDiff(NGitLab.Sha1 sha) -> System.Collections.Generic.IEnumerable +NGitLab.Impl.RepositoryClient.GetCommitDiffAsync(NGitLab.Sha1 sha, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IAsyncEnumerable NGitLab.Impl.RepositoryClient.GetCommitRefs(NGitLab.Sha1 sha, NGitLab.Models.CommitRefType type = NGitLab.Models.CommitRefType.All) -> System.Collections.Generic.IEnumerable NGitLab.Impl.RepositoryClient.GetCommits(NGitLab.GetCommitsRequest request) -> System.Collections.Generic.IEnumerable NGitLab.Impl.RepositoryClient.GetCommits(string refName, int maxResults = 0) -> System.Collections.Generic.IEnumerable +NGitLab.Impl.RepositoryClient.GetCommitsAsync(NGitLab.GetCommitsRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IAsyncEnumerable NGitLab.Impl.RepositoryClient.GetRawBlob(string sha, System.Action parser) -> void NGitLab.Impl.RepositoryClient.GetTree(NGitLab.Models.RepositoryGetTreeOptions options) -> System.Collections.Generic.IEnumerable NGitLab.Impl.RepositoryClient.GetTree(string path) -> System.Collections.Generic.IEnumerable @@ -1139,10 +1146,13 @@ NGitLab.IRepositoryClient.Contributors.get -> NGitLab.IContributorClient NGitLab.IRepositoryClient.Files.get -> NGitLab.IFilesClient NGitLab.IRepositoryClient.GetArchive(System.Action parser) -> void NGitLab.IRepositoryClient.GetCommit(NGitLab.Sha1 sha) -> NGitLab.Models.Commit +NGitLab.IRepositoryClient.GetCommitAsync(NGitLab.Sha1 sha, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task NGitLab.IRepositoryClient.GetCommitDiff(NGitLab.Sha1 sha) -> System.Collections.Generic.IEnumerable +NGitLab.IRepositoryClient.GetCommitDiffAsync(NGitLab.Sha1 sha, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IAsyncEnumerable NGitLab.IRepositoryClient.GetCommitRefs(NGitLab.Sha1 sha, NGitLab.Models.CommitRefType type = NGitLab.Models.CommitRefType.All) -> System.Collections.Generic.IEnumerable NGitLab.IRepositoryClient.GetCommits(NGitLab.GetCommitsRequest request) -> System.Collections.Generic.IEnumerable NGitLab.IRepositoryClient.GetCommits(string refName, int maxResults = 0) -> System.Collections.Generic.IEnumerable +NGitLab.IRepositoryClient.GetCommitsAsync(NGitLab.GetCommitsRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IAsyncEnumerable NGitLab.IRepositoryClient.GetRawBlob(string sha, System.Action parser) -> void NGitLab.IRepositoryClient.GetTree(NGitLab.Models.RepositoryGetTreeOptions options) -> System.Collections.Generic.IEnumerable NGitLab.IRepositoryClient.GetTree(string path) -> System.Collections.Generic.IEnumerable