fork default branch only in pr create
This commit is contained in:
parent
4e65637471
commit
7448aed8ab
2 changed files with 5 additions and 3 deletions
|
|
@ -1128,7 +1128,7 @@ func handlePush(opts CreateOptions, ctx CreateContext) error {
|
|||
forkableRefs, requiresFork := refs.(forkableRefs)
|
||||
if requiresFork {
|
||||
opts.IO.StartProgressIndicator()
|
||||
forkedRepo, err := api.ForkRepo(ctx.Client, forkableRefs.BaseRepo(), "", "", false)
|
||||
forkedRepo, err := api.ForkRepo(ctx.Client, forkableRefs.BaseRepo(), "", "", true)
|
||||
opts.IO.StopProgressIndicator()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error forking repo: %w", err)
|
||||
|
|
|
|||
|
|
@ -894,11 +894,13 @@ func Test_createRun(t *testing.T) {
|
|||
httpmock.StringResponse(`{"data": {"viewer": {"login": "monalisa"} } }`))
|
||||
reg.Register(
|
||||
httpmock.REST("POST", "repos/OWNER/REPO/forks"),
|
||||
httpmock.StatusStringResponse(201, `
|
||||
httpmock.RESTPayload(201, `
|
||||
{ "node_id": "NODEID",
|
||||
"name": "REPO",
|
||||
"owner": {"login": "monalisa"}
|
||||
}`))
|
||||
}`, func(payload map[string]interface{}) {
|
||||
assert.Equal(t, true, payload["default_branch_only"])
|
||||
}))
|
||||
reg.Register(
|
||||
httpmock.GraphQL(`mutation PullRequestCreate\b`),
|
||||
httpmock.GraphQLMutation(`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue