Get the SHA-1 of a commit reference

Updated RepositoryCommitsClients and unit/integration tests
This commit is contained in:
Roger Tinsley
2016-03-16 21:59:33 +00:00
parent f354d1bf00
commit 5dfe1968da
4 changed files with 63 additions and 0 deletions
@@ -79,5 +79,21 @@ namespace Octokit
return _apiConnection.GetAll<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 Task<string> Sha1(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return _apiConnection.Get<string>(ApiUrls.RepositoryCommit(owner, name, reference), null, AcceptHeaders.CommitReferenceSha1Preview);
}
}
}