mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
implement get repository commit
implementation for getting a single repository commit. Includes implementation, unit tests and xml docs
This commit is contained in:
@@ -8,6 +8,7 @@ namespace Octokit.Reactive
|
||||
{
|
||||
readonly IGitHubClient _client;
|
||||
readonly IConnection _connection;
|
||||
readonly IRepositoryCommitsClient _commit;
|
||||
|
||||
public ObservableRepositoryCommitsClient(IGitHubClient client)
|
||||
{
|
||||
@@ -15,6 +16,7 @@ namespace Octokit.Reactive
|
||||
|
||||
_client = client;
|
||||
_connection = client.Connection;
|
||||
_commit = client.Repository.Commits;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -30,6 +32,22 @@ namespace Octokit.Reactive
|
||||
return _client.Repository.Commits.Compare(owner, name, @base, head).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="reference">The reference for the commit</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<GitHubCommit> Get(string owner, string name, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(reference, "reference");
|
||||
|
||||
return _commit.Get(owner, name, reference).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user