Get the SHA-1 of a commit reference

Added implementation for Reactive framework
This commit is contained in:
Roger Tinsley
2016-03-16 22:01:45 +00:00
parent 5dfe1968da
commit 5270b3783e
2 changed files with 25 additions and 0 deletions

View File

@@ -43,5 +43,14 @@ namespace Octokit.Reactive
/// <param name="request">Used to filter list of commits returned</param>
/// <returns></returns>
IObservable<GitHubCommit> GetAll(string owner, string name, CommitRequest request);
/// <summary>
/// Get the SHA-1 of a commit reference
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The repository reference</param>
/// <returns></returns>
IObservable<string> Sha1(string owner, string name, string reference);
}
}

View File

@@ -73,5 +73,21 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name),
request.ToParametersDictionary());
}
/// <summary>
/// Get the SHA-1 of a commit reference
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The repository reference</param>
/// <returns></returns>
public IObservable<string> Sha1(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return _commit.Sha1(owner, name, reference).ToObservable();
}
}
}