mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 06:05:12 +00:00
moved function out to separate client
This commit is contained in:
24
Octokit/Clients/RepositoryCommitsClient.cs
Normal file
24
Octokit/Clients/RepositoryCommitsClient.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class RepositoryCommitsClient : IRepositoryCommitsClient
|
||||
{
|
||||
readonly IApiConnection _apiConnection;
|
||||
|
||||
public RepositoryCommitsClient(IApiConnection apiConnection)
|
||||
{
|
||||
_apiConnection = apiConnection;
|
||||
}
|
||||
|
||||
public Task<CompareResult> Compare(string owner, string name, string @base, string head)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "repositoryName");
|
||||
Ensure.ArgumentNotNullOrEmptyString(@base, "base");
|
||||
Ensure.ArgumentNotNullOrEmptyString(head, "head");
|
||||
|
||||
return _apiConnection.Get<CompareResult>(ApiUrls.RepoCompare(owner, name, @base, head));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user