mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 22:25:12 +00:00
Get the SHA-1 of a commit reference
Added implementation for Reactive framework
This commit is contained in:
@@ -43,5 +43,14 @@ namespace Octokit.Reactive
|
|||||||
/// <param name="request">Used to filter list of commits returned</param>
|
/// <param name="request">Used to filter list of commits returned</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IObservable<GitHubCommit> GetAll(string owner, string name, CommitRequest request);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,5 +73,21 @@ namespace Octokit.Reactive
|
|||||||
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name),
|
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name),
|
||||||
request.ToParametersDictionary());
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user