Skip to content

Commit ebf2bb9

Browse files
authored
Merge pull request cli#3714 from cli/pr-checkout-push
Fix `pr checkout` setting up git push configuration
2 parents b9a4a42 + 053d43f commit ebf2bb9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/cmd/pr/checkout/checkout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func NewCmdCheckout(f *cmdutil.Factory, runF func(*CheckoutOptions) error) *cobr
7272
func checkoutRun(opts *CheckoutOptions) error {
7373
findOptions := shared.FindOptions{
7474
Selector: opts.SelectorArg,
75-
Fields: []string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository"},
75+
Fields: []string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"},
7676
}
7777
pr, baseRepo, err := opts.Finder.Find(findOptions)
7878
if err != nil {

pkg/cmd/pr/checkout/checkout_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func TestPRCheckout_sameRepo(t *testing.T) {
205205

206206
baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature")
207207
finder := shared.RunCommandFinder("123", pr, baseRepo)
208-
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository"})
208+
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"})
209209

210210
cs, cmdTeardown := run.Stub()
211211
defer cmdTeardown(t)
@@ -260,7 +260,7 @@ func TestPRCheckout_differentRepo_remoteExists(t *testing.T) {
260260

261261
baseRepo, pr := stubPR("OWNER/REPO", "hubot/REPO:feature")
262262
finder := shared.RunCommandFinder("123", pr, baseRepo)
263-
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository"})
263+
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"})
264264

265265
cs, cmdTeardown := run.Stub()
266266
defer cmdTeardown(t)
@@ -283,7 +283,7 @@ func TestPRCheckout_differentRepo(t *testing.T) {
283283

284284
baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature")
285285
finder := shared.RunCommandFinder("123", pr, baseRepo)
286-
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository"})
286+
finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"})
287287

288288
cs, cmdTeardown := run.Stub()
289289
defer cmdTeardown(t)

0 commit comments

Comments
 (0)