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
6 changes: 0 additions & 6 deletions pkg/cmd/pr/shared/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err

fields := set.NewStringSet()
fields.AddValues(opts.Fields)
numberFieldOnly := fields.Len() == 1 && fields.Contains("number")
fields.AddValues([]string{"id", "number"}) // for additional preload queries below

if fields.Contains("isInMergeQueue") || fields.Contains("isMergeQueueEnabled") {
Expand Down Expand Up @@ -248,11 +247,6 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err

var pr *api.PullRequest
if f.prNumber > 0 {
// If we have a PR number, let's look it up
if numberFieldOnly {
// avoid hitting the API if we already have all the information
return &api.PullRequest{Number: f.prNumber}, f.baseRefRepo, nil
}
pr, err = findByNumber(httpClient, f.baseRefRepo, f.prNumber, fields.ToSlice())
if err != nil {
return pr, f.baseRefRepo, err
Expand Down
19 changes: 0 additions & 19 deletions pkg/cmd/pr/shared/finder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,25 +326,6 @@ func TestFind(t *testing.T) {
},
wantErr: true,
},
{
name: "number only",
args: args{
selector: "13",
fields: []string{"number"},
baseRepoFn: stubBaseRepoFn(ghrepo.New("ORIGINOWNER", "REPO"), nil),
branchFn: func() (string, error) {
return "blueberries", nil
},
gitConfigClient: stubGitConfigClient{
readBranchConfigFn: stubBranchConfig(git.BranchConfig{}, nil),
pushDefaultFn: stubPushDefault(git.PushDefaultSimple, nil),
remotePushDefaultFn: stubRemotePushDefault("", nil),
},
},
httpStub: nil,
wantPR: 13,
wantRepo: "https://github.com/ORIGINOWNER/REPO",
},
{
name: "pr number zero",
args: args{
Expand Down
Loading