mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 12:03:19 +00:00
Repository Commits Get All
Added the logic for getting all commits for a repository including unit tests and XML docs
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
using System;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using Octokit.Reactive.Internal;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
public class ObservableRepositoryCommitsClient : IObservableRepositoryCommitsClient
|
||||
{
|
||||
readonly IGitHubClient _client;
|
||||
readonly IConnection _connection;
|
||||
|
||||
public ObservableRepositoryCommitsClient(IGitHubClient client)
|
||||
{
|
||||
Ensure.ArgumentNotNull(client, "client");
|
||||
|
||||
_client = client;
|
||||
_connection = client.Connection;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -24,5 +29,19 @@ 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>
|
||||
/// <returns></returns>
|
||||
public IObservable<GitHubCommit> GetAll(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user