diff --git a/Octokit.Reactive/Clients/IObservableRepositoryCommitsClients.cs b/Octokit.Reactive/Clients/IObservableRepositoryCommitsClients.cs
index 1766057678..f9b2c95c0e 100644
--- a/Octokit.Reactive/Clients/IObservableRepositoryCommitsClients.cs
+++ b/Octokit.Reactive/Clients/IObservableRepositoryCommitsClients.cs
@@ -11,6 +11,38 @@ namespace Octokit.Reactive
///
public interface IObservableRepositoryCommitsClient
{
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ IObservable BranchesWhereHead(long repositoryId, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ IObservable BranchesWhereHead(long repositoryId, string sha1, ApiOptions options);
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ IObservable BranchesWhereHead(string owner, string name, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ IObservable BranchesWhereHead(string owner, string name, string sha1, ApiOptions options);
+
///
/// Compare two references in a repository
///
@@ -123,5 +155,37 @@ public interface IObservableRepositoryCommitsClient
/// The Id of the repository
/// The repository reference
IObservable GetSha1(long repositoryId, string reference);
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ IObservable PullRequests(string owner, string name, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ IObservable PullRequests(long repositoryId, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ IObservable PullRequests(long repositoryId, string sha1, ApiOptions options);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ IObservable PullRequests(string owner, string name, string sha1, ApiOptions options);
}
}
diff --git a/Octokit.Reactive/Clients/ObservableRepositoryCommitsClients.cs b/Octokit.Reactive/Clients/ObservableRepositoryCommitsClients.cs
index 121bf5b4e4..a2f6ad73ff 100644
--- a/Octokit.Reactive/Clients/ObservableRepositoryCommitsClients.cs
+++ b/Octokit.Reactive/Clients/ObservableRepositoryCommitsClients.cs
@@ -23,6 +23,62 @@ public ObservableRepositoryCommitsClient(IGitHubClient client)
_commit = client.Repository.Commit;
}
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/branches-where-head")]
+ public IObservable BranchesWhereHead(long repositoryId, string sha1)
+ {
+ return BranchesWhereHead(repositoryId, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/branches-where-head")]
+ public IObservable BranchesWhereHead(long repositoryId, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryCommitsBranchesWhereHead(repositoryId, sha1), null, options);
+ }
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head")]
+ public IObservable BranchesWhereHead(string owner, string name, string sha1)
+ {
+ return BranchesWhereHead(owner, name, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head")]
+ public IObservable BranchesWhereHead(string owner, string name, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryCommitsBranchesWhereHead(owner, name, sha1), null, options);
+ }
+
///
/// Compare two references in a repository
///
@@ -214,5 +270,61 @@ public IObservable GetSha1(long repositoryId, string reference)
return _commit.GetSha1(repositoryId, reference).ToObservable();
}
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/pulls")]
+ public IObservable PullRequests(long repositoryId, string sha1)
+ {
+ return PullRequests(repositoryId, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/pulls")]
+ public IObservable PullRequests(long repositoryId, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryCommitsPull(repositoryId, sha1), null, options);
+ }
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/pulls")]
+ public IObservable PullRequests(string owner, string name, string sha1)
+ {
+ return PullRequests(owner, name, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/pulls")]
+ public IObservable PullRequests(string owner, string name, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryCommitsPull(owner, name, sha1), null, options);
+ }
}
}
diff --git a/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs b/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs
index 3e235c4e96..c75fe1d919 100644
--- a/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs
+++ b/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs
@@ -350,5 +350,63 @@ public async Task EnsuresNonNullArguments()
await Assert.ThrowsAsync(() => client.GetSha1(1, ""));
}
}
+
+ public class ThePullRequestsMethod
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new RepositoryCommitsClient(connection);
+ var options = new ApiOptions
+ {
+ PageCount = 1,
+ StartPage = 1,
+ PageSize = 1
+ };
+
+ await client.PullRequests("fake", "repo", "ref", options);
+
+ connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/pulls"),
+ null, options);
+ }
+
+ [Fact]
+ public async Task RequestsCorrectUrlWithRepositoryId()
+ {
+ var connection = Substitute.For();
+ var client = new RepositoryCommitsClient(connection);
+ var options = new ApiOptions
+ {
+ PageCount = 1,
+ StartPage = 1,
+ PageSize = 1
+ };
+
+ await client.PullRequests(1, "ref", options);
+
+ connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/commits/ref/pulls"),
+ null, options);
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var connection = Substitute.For();
+ var client = new RepositoryCommitsClient(connection);
+
+ await Assert.ThrowsAsync(() => client.PullRequests(null, "name", "ref"));
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", null, "ref"));
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "name", null));
+
+ await Assert.ThrowsAsync(() => client.PullRequests(1, null));
+
+ await Assert.ThrowsAsync(() => client.PullRequests("", "name", "ref"));
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "", "ref"));
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "name", ""));
+
+ await Assert.ThrowsAsync(() => client.PullRequests(1, ""));
+ }
+ }
}
}
diff --git a/Octokit.Tests/Reactive/ObservableRepositoryCommitsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryCommitsClientTests.cs
index 3aaec54682..841ef7b9e6 100644
--- a/Octokit.Tests/Reactive/ObservableRepositoryCommitsClientTests.cs
+++ b/Octokit.Tests/Reactive/ObservableRepositoryCommitsClientTests.cs
@@ -98,5 +98,73 @@ public async Task GetsCorrectUrl()
.GetAll(1);
}
}
+
+ public class ThePullRequestsMethod
+ {
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var client = new ObservableRepositoryCommitsClient(Substitute.For());
+
+ await Assert.ThrowsAsync(() => client.PullRequests("", "name", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "name", "").ToTask());
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var client = new ObservableRepositoryCommitsClient(Substitute.For());
+
+ await Assert.ThrowsAsync(() => client.PullRequests(null, "name", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", null, "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.PullRequests("owner", "name", null).ToTask());
+ }
+
+ [Fact]
+ public void GetsCorrectUrl()
+ {
+ var githubClient = Substitute.For();
+ var client = new ObservableRepositoryCommitsClient(githubClient);
+ var options = new ApiOptions();
+
+ client.PullRequests("fake", "repo", "reference", options);
+ githubClient.Received().Repository.Commit.PullRequests("fake", "repo", "reference", options);
+ }
+ }
+
+ public class TheBranchesWhereHeadMethod
+ {
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var client = new ObservableRepositoryCommitsClient(Substitute.For());
+
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead("", "name", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead("owner", "", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead("owner", "name", "").ToTask());
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var client = new ObservableRepositoryCommitsClient(Substitute.For());
+
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead(null, "name", "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead("owner", null, "reference").ToTask());
+ await Assert.ThrowsAsync(() => client.BranchesWhereHead("owner", "name", null).ToTask());
+ }
+
+ [Fact]
+ public void GetsCorrectUrl()
+ {
+ var githubClient = Substitute.For();
+ var client = new ObservableRepositoryCommitsClient(githubClient);
+ var options = new ApiOptions();
+
+ client.BranchesWhereHead("fake", "repo", "reference", options);
+ githubClient.Received().Repository.Commit.BranchesWhereHead("fake", "repo", "reference", options);
+ }
+ }
}
}
diff --git a/Octokit/Clients/IRepositoryCommitsClient.cs b/Octokit/Clients/IRepositoryCommitsClient.cs
index dffa3a8dab..c91f8542b3 100644
--- a/Octokit/Clients/IRepositoryCommitsClient.cs
+++ b/Octokit/Clients/IRepositoryCommitsClient.cs
@@ -12,6 +12,38 @@ namespace Octokit
///
public interface IRepositoryCommitsClient
{
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ Task> BranchesWhereHead(long repositoryId, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ Task> BranchesWhereHead(long repositoryId, string sha1, ApiOptions options);
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ Task> BranchesWhereHead(string owner, string name, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ Task> BranchesWhereHead(string owner, string name, string sha1, ApiOptions options);
+
///
/// Compare two references in a repository
///
@@ -124,5 +156,37 @@ public interface IRepositoryCommitsClient
/// The Id of the repository
/// The repository reference
Task GetSha1(long repositoryId, string reference);
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ Task> PullRequests(string owner, string name, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ Task> PullRequests(long repositoryId, string sha1);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ Task> PullRequests(long repositoryId, string sha1, ApiOptions options);
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ Task> PullRequests(string owner, string name, string sha1, ApiOptions options);
}
}
diff --git a/Octokit/Clients/RepositoryCommitsClient.cs b/Octokit/Clients/RepositoryCommitsClient.cs
index 8f03bdc7a9..bf32ea4e68 100644
--- a/Octokit/Clients/RepositoryCommitsClient.cs
+++ b/Octokit/Clients/RepositoryCommitsClient.cs
@@ -16,6 +16,62 @@ public RepositoryCommitsClient(IApiConnection apiConnection)
{
}
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/branches-where-head")]
+ public Task> BranchesWhereHead(long repositoryId, string sha1)
+ {
+ return BranchesWhereHead(repositoryId, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/branches-where-head")]
+ public Task> BranchesWhereHead(long repositoryId, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return ApiConnection.GetAll(ApiUrls.RepositoryCommitsBranchesWhereHead(repositoryId, sha1), null, options);
+ }
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head")]
+ public Task> BranchesWhereHead(string owner, string name, string sha1)
+ {
+ return BranchesWhereHead(owner, name, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all branches where the given commit SHA is the HEAD, or latest commit for the branch
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head")]
+ public Task> BranchesWhereHead(string owner, string name, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return ApiConnection.GetAll(ApiUrls.RepositoryCommitsBranchesWhereHead(owner, name, sha1), null, options);
+ }
+
///
/// Compare two references in a repository
///
@@ -218,5 +274,61 @@ public Task GetSha1(long repositoryId, string reference)
return ApiConnection.Get(ApiUrls.RepositoryCommit(repositoryId, reference), null);
}
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/pulls")]
+ public Task> PullRequests(long repositoryId, string sha1)
+ {
+ return PullRequests(repositoryId, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The Id of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/pulls")]
+ public Task> PullRequests(long repositoryId, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return ApiConnection.GetAll(ApiUrls.RepositoryCommitsPull(repositoryId, sha1), null, options);
+ }
+
+ ///
+ /// List pull requests associated with a commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/pulls")]
+ public Task> PullRequests(string owner, string name, string sha1)
+ {
+ return PullRequests(owner, name, sha1, ApiOptions.None);
+ }
+
+ ///
+ /// Gets all pull requests for a given commit
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// Used to find all pull requests containing the provided commit SHA, which can be from any point in the commit history
+ /// /// Options for changing the API response
+ [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/pulls")]
+ public Task> PullRequests(string owner, string name, string sha1, ApiOptions options)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
+ Ensure.ArgumentNotNullOrEmptyString(sha1, nameof(sha1));
+ Ensure.ArgumentNotNull(options, nameof(options));
+
+ return ApiConnection.GetAll(ApiUrls.RepositoryCommitsPull(owner, name, sha1), null, options);
+ }
}
}
diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs
index c4ae3b26b9..29f369d132 100644
--- a/Octokit/Helpers/ApiUrls.cs
+++ b/Octokit/Helpers/ApiUrls.cs
@@ -2209,6 +2209,53 @@ public static Uri RepositoryCommits(string owner, string name)
return "repos/{0}/{1}/commits".FormatUri(owner, name);
}
+ ///repos/{owner}/{repo}/commits/{commit_sha}/
+ ///
+ /// Returns the that lists all branches where the given commit SHA is the HEAD, or latest commit for the branch.
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// The commit reference (SHA)
+ ///
+ public static Uri RepositoryCommitsBranchesWhereHead(string owner, string name, string reference)
+ {
+ return "repos/{0}/{1}/commits/{2}/branches-where-head".FormatUri(owner, name, reference);
+ }
+
+ ///
+ /// Returns the that lists all branches where the given commit SHA is the HEAD, or latest commit for the branch.
+ ///
+ /// The Id of the repository
+ /// The commit reference (SHA)
+ ///
+ public static Uri RepositoryCommitsBranchesWhereHead(long repositoryId, string reference)
+ {
+ return "repositories/{0}/commits/{1}/branches-where-head".FormatUri(repositoryId, reference);
+ }
+
+ ///
+ /// Returns the that lists the check suites for the specified reference.
+ ///
+ /// The owner of the repository
+ /// The name of the repository
+ /// The commit reference (SHA)
+ ///
+ public static Uri RepositoryCommitsPull(string owner, string name, string reference)
+ {
+ return "repos/{0}/{1}/commits/{2}/pulls".FormatUri(owner, name, reference);
+ }
+
+ ///
+ /// Returns the that lists the check suites for the specified reference.
+ ///
+ /// The Id of the repository
+ /// The commit reference (SHA)
+ ///
+ public static Uri RepositoryCommitsPull(long repositoryId, string reference)
+ {
+ return "repositories/{0}/commits/{1}/pulls".FormatUri(repositoryId, reference);
+ }
+
///
/// Returns the for comparing two commits.
///
diff --git a/Octokit/Models/Response/CommitPullRequest.cs b/Octokit/Models/Response/CommitPullRequest.cs
new file mode 100644
index 0000000000..eb011fb4ba
--- /dev/null
+++ b/Octokit/Models/Response/CommitPullRequest.cs
@@ -0,0 +1,199 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using Octokit.Internal;
+
+namespace Octokit
+{
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class CommitPullRequest
+ {
+ public CommitPullRequest() { }
+
+ public CommitPullRequest(int number)
+ {
+ Number = number;
+ }
+
+ public CommitPullRequest(long id, string nodeId, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList assignees, bool draft, bool? mergeable, MergeableState? mergeableState, User mergedBy, string mergeCommitSha, Milestone milestone, IReadOnlyList requestedReviewers, IReadOnlyList requestedTeams, IReadOnlyList