Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion github/pulls.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin
// By default, the PullRequestListOptions State filters for "open".
//
// GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit
func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) {
func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha)
u, err := addOptions(u, opts)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions github/pulls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,12 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeListPullsOrBranchesForCommitPreview)
testFormValues(t, r, values{
"state": "closed",
"head": "h",
"base": "b",
"sort": "created",
"direction": "desc",
"page": "2",
"page": "2",
})
fmt.Fprint(w, `[{"number":1}]`)
})

opts := &PullRequestListOptions{"closed", "h", "b", "created", "desc", ListOptions{Page: 2}}
opts := &ListOptions{Page: 2}
ctx := context.Background()
pulls, _, err := client.PullRequests.ListPullRequestsWithCommit(ctx, "o", "r", "sha", opts)
if err != nil {
Expand Down