MCPcopy
hub / github.com/cli/cli / listPullRequests

Function listPullRequests

pkg/cmd/pr/list/http.go:17–30  ·  view source on GitHub ↗
(httpClient *http.Client, detector fd.Detector, repo ghrepo.Interface, filters prShared.FilterOptions, limit int)

Source from the content-addressed store, hash-verified

15}
16
17func listPullRequests(httpClient *http.Client, detector fd.Detector, repo ghrepo.Interface, filters prShared.FilterOptions, limit int) (*api.PullRequestAndTotalCount, error) {
18 if shouldUseSearch(filters) {
19 return searchPullRequests(httpClient, detector, repo, filters, limit)
20 }
21
22 return prShared.NewLister(httpClient).List(prShared.ListOptions{
23 BaseRepo: repo,
24 LimitResults: limit,
25 State: filters.State,
26 BaseBranch: filters.BaseBranch,
27 HeadBranch: filters.HeadBranch,
28 Fields: filters.Fields,
29 })
30}
31
32func searchPullRequests(httpClient *http.Client, detector fd.Detector, repo ghrepo.Interface, filters prShared.FilterOptions, limit int) (*api.PullRequestAndTotalCount, error) {
33 // TODO advancedIssueSearchCleanup

Callers 4

listRunFunction · 0.85
Test_ListPullRequestsFunction · 0.85

Calls 3

shouldUseSearchFunction · 0.85
searchPullRequestsFunction · 0.85
ListMethod · 0.65

Tested by 3

Test_ListPullRequestsFunction · 0.68