diff --git a/github/pulls.go b/github/pulls.go index 6e49eba2f91..533e86b5f0a 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -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 { diff --git a/github/pulls_test.go b/github/pulls_test.go index 590483fadb3..87f6f41cfb8 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -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 {