File tree Expand file tree Collapse file tree 2 files changed +12
-30
lines changed Expand file tree Collapse file tree 2 files changed +12
-30
lines changed Original file line number Diff line number Diff line change @@ -388,17 +388,13 @@ func createRun(opts *CreateOptions) error {
388
388
return err
389
389
}
390
390
391
- if opts .TitleProvided {
392
- state .Title = opts .Title
393
- }
394
-
395
- if opts .BodyProvided {
396
- state .Body = opts .Body
397
- }
398
-
399
391
var openURL string
400
392
401
393
if opts .WebMode {
394
+ if ! (opts .Autofill || opts .FillFirst ) {
395
+ state .Title = opts .Title
396
+ state .Body = opts .Body
397
+ }
402
398
if opts .Template != "" {
403
399
state .Template = opts .Template
404
400
}
@@ -417,6 +413,14 @@ func createRun(opts *CreateOptions) error {
417
413
return previewPR (* opts , openURL )
418
414
}
419
415
416
+ if opts .TitleProvided {
417
+ state .Title = opts .Title
418
+ }
419
+
420
+ if opts .BodyProvided {
421
+ state .Body = opts .Body
422
+ }
423
+
420
424
existingPR , _ , err := opts .Finder .Find (shared.FindOptions {
421
425
Selector : ctx .PRRefs .QualifiedHeadRef (),
422
426
BaseBranch : ctx .PRRefs .BaseRef (),
Original file line number Diff line number Diff line change @@ -1590,28 +1590,6 @@ func Test_createRun(t *testing.T) {
1590
1590
},
1591
1591
expectedOut : "https://github.com/OWNER/REPO/pull/12\n " ,
1592
1592
},
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
- },
1615
1593
}
1616
1594
for _ , tt := range tests {
1617
1595
t .Run (tt .name , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments