| 15 | } |
| 16 | |
| 17 | func 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 | |
| 32 | func searchPullRequests(httpClient *http.Client, detector fd.Detector, repo ghrepo.Interface, filters prShared.FilterOptions, limit int) (*api.PullRequestAndTotalCount, error) { |
| 33 | // TODO advancedIssueSearchCleanup |