moved function out to separate client

This commit is contained in:
Brendan Forster
2014-03-08 19:11:59 +11:00
parent ba82c4ea68
commit e6be0ad334
11 changed files with 77 additions and 36 deletions

View File

@@ -28,6 +28,7 @@ namespace Octokit
Deployment = new DeploymentsClient(apiConnection);
PullRequest = new PullRequestsClient(apiConnection);
RepositoryComments = new RepositoryCommentsClient(apiConnection);
Commits = new RepositoryCommitsClient(apiConnection);
}
/// <summary>
@@ -279,6 +280,14 @@ namespace Octokit
///</remarks>
public IStatisticsClient Statistics { get; private set; }
/// <summary>
/// Client for GitHub's Repository Commits API
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/commits/">Commits API documentation</a> for more details
///</remarks>
public IRepositoryCommitsClient Commits { get; private set; }
/// <summary>
/// Client for managing pull requests.
/// </summary>
@@ -426,23 +435,5 @@ namespace Octokit
return ApiConnection.Get<Branch>(ApiUrls.RepoBranch(owner, repositoryName, branchName));
}
/// <summary>
/// Compare two references in a repository
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="base">The reference to use as the base commit</param>
/// <param name="head">The reference to use as the head commit</param>
/// <returns></returns>
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));
}
}
}