File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,17 +388,13 @@ func createRun(opts *CreateOptions) error {
388388 return err
389389 }
390390
391- if opts .TitleProvided {
392- state .Title = opts .Title
393- }
394-
395- if opts .BodyProvided {
396- state .Body = opts .Body
397- }
398-
399391 var openURL string
400392
401393 if opts .WebMode {
394+ if ! (opts .Autofill || opts .FillFirst ) {
395+ state .Title = opts .Title
396+ state .Body = opts .Body
397+ }
402398 if opts .Template != "" {
403399 state .Template = opts .Template
404400 }
@@ -417,6 +413,14 @@ func createRun(opts *CreateOptions) error {
417413 return previewPR (* opts , openURL )
418414 }
419415
416+ if opts .TitleProvided {
417+ state .Title = opts .Title
418+ }
419+
420+ if opts .BodyProvided {
421+ state .Body = opts .Body
422+ }
423+
420424 existingPR , _ , err := opts .Finder .Find (shared.FindOptions {
421425 Selector : ctx .PRRefs .QualifiedHeadRef (),
422426 BaseBranch : ctx .PRRefs .BaseRef (),
Original file line number Diff line number Diff line change @@ -1590,28 +1590,6 @@ func Test_createRun(t *testing.T) {
15901590 },
15911591 expectedOut : "https://github.com/OWNER/REPO/pull/12\n " ,
15921592 },
1593- {
1594- name : "web prioritize title and body over fill" ,
1595- setup : func (opts * CreateOptions , t * testing.T ) func () {
1596- opts .WebMode = true
1597- opts .HeadBranch = "feature"
1598- opts .TitleProvided = true
1599- opts .BodyProvided = true
1600- opts .Title = "my title"
1601- opts .Body = "my body"
1602- opts .Autofill = true
1603- return func () {}
1604- },
1605- cmdStubs : func (cs * run.CommandStubber ) {
1606- cs .Register (
1607- "git -c log.ShowSignature=false log --pretty=format:%H%x00%s%x00%b%x00 --cherry origin/master...feature" ,
1608- 0 ,
1609- "56b6f8bb7c9e3a30093cd17e48934ce354148e80\u0000 second commit of pr\u0000 \u0000 \n " +
1610- "3a9b48085046d156c5acce8f3b3a0532cd706a4a\u0000 first commit of pr\u0000 first commit description\u0000 \n " ,
1611- )
1612- },
1613- expectedBrowse : "https://github.com/OWNER/REPO/compare/master...feature?body=my+body&expand=1&title=my+title" ,
1614- },
16151593 }
16161594 for _ , tt := range tests {
16171595 t .Run (tt .name , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments