@@ -185,6 +185,12 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
185185 opts .Editable .IssueType .Edited = true
186186 }
187187
188+ // hasDeferredFlags covers edit flags that flow through the
189+ // deferred update path rather than the prShared.Editable struct,
190+ // so they would otherwise be invisible to Editable.Dirty() below.
191+ // Note that --type (set) is intentionally absent: it lights up
192+ // opts.Editable.IssueType.Edited above, which Editable.Dirty()
193+ // already picks up. Only --remove-type needs to be listed here.
188194 hasDeferredFlags := opts .RemoveIssueType ||
189195 flags .Changed ("parent" ) || opts .RemoveParent ||
190196 len (opts .AddSubIssues ) > 0 || len (opts .RemoveSubIssues ) > 0 ||
@@ -482,52 +488,52 @@ func deferredUpdateIssueOptions(client *api.Client, baseRepo ghrepo.Interface, i
482488 } else if editOpts .Parent != "" {
483489 parentID , err := issueShared .ResolveIssueRef (client , baseRepo , editOpts .Parent )
484490 if err != nil {
485- return updateOpts , fmt .Errorf ("resolving --parent reference %q: %w" , editOpts .Parent , err )
491+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --parent reference %q: %w" , editOpts .Parent , err )
486492 }
487493 updateOpts .ParentID = parentID
488494 }
489495
490496 for _ , ref := range editOpts .AddSubIssues {
491497 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
492498 if err != nil {
493- return updateOpts , fmt .Errorf ("resolving --add-sub-issue reference %q: %w" , ref , err )
499+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --add-sub-issue reference %q: %w" , ref , err )
494500 }
495501 updateOpts .AddSubIssueIDs = append (updateOpts .AddSubIssueIDs , id )
496502 }
497503 for _ , ref := range editOpts .RemoveSubIssues {
498504 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
499505 if err != nil {
500- return updateOpts , fmt .Errorf ("resolving --remove-sub-issue reference %q: %w" , ref , err )
506+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --remove-sub-issue reference %q: %w" , ref , err )
501507 }
502508 updateOpts .RemoveSubIssueIDs = append (updateOpts .RemoveSubIssueIDs , id )
503509 }
504510
505511 for _ , ref := range editOpts .AddBlockedBy {
506512 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
507513 if err != nil {
508- return updateOpts , fmt .Errorf ("resolving --add-blocked-by reference %q: %w" , ref , err )
514+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --add-blocked-by reference %q: %w" , ref , err )
509515 }
510516 updateOpts .AddBlockedByIDs = append (updateOpts .AddBlockedByIDs , id )
511517 }
512518 for _ , ref := range editOpts .RemoveBlockedBy {
513519 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
514520 if err != nil {
515- return updateOpts , fmt .Errorf ("resolving --remove-blocked-by reference %q: %w" , ref , err )
521+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --remove-blocked-by reference %q: %w" , ref , err )
516522 }
517523 updateOpts .RemoveBlockedByIDs = append (updateOpts .RemoveBlockedByIDs , id )
518524 }
519525
520526 for _ , ref := range editOpts .AddBlocking {
521527 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
522528 if err != nil {
523- return updateOpts , fmt .Errorf ("resolving --add-blocking reference %q: %w" , ref , err )
529+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --add-blocking reference %q: %w" , ref , err )
524530 }
525531 updateOpts .AddBlockingIDs = append (updateOpts .AddBlockingIDs , id )
526532 }
527533 for _ , ref := range editOpts .RemoveBlocking {
528534 id , err := issueShared .ResolveIssueRef (client , baseRepo , ref )
529535 if err != nil {
530- return updateOpts , fmt .Errorf ("resolving --remove-blocking reference %q: %w" , ref , err )
536+ return api. DeferredUpdateIssueOptions {} , fmt .Errorf ("resolving --remove-blocking reference %q: %w" , ref , err )
531537 }
532538 updateOpts .RemoveBlockingIDs = append (updateOpts .RemoveBlockingIDs , id )
533539 }
0 commit comments