@@ -322,7 +322,7 @@ func secondaryPatchPanelUpdateOpts(c *ControllerCommon) *types.ViewUpdateOpts {
322
322
323
323
func (self * LocalCommitsController ) squashDown (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
324
324
if self .isRebasing () {
325
- return self .updateTodos (todo .Squash , selectedCommits )
325
+ return self .updateTodos (todo .Squash , "" , selectedCommits )
326
326
}
327
327
328
328
self .c .Confirm (types.ConfirmOpts {
@@ -331,7 +331,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
331
331
HandleConfirm : func () error {
332
332
return self .c .WithWaitingStatus (self .c .Tr .SquashingStatus , func (gocui.Task ) error {
333
333
self .c .LogAction (self .c .Tr .Actions .SquashCommitDown )
334
- return self .interactiveRebase (todo .Squash , startIdx , endIdx )
334
+ return self .interactiveRebase (todo .Squash , "" , startIdx , endIdx )
335
335
})
336
336
},
337
337
})
@@ -341,7 +341,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
341
341
342
342
func (self * LocalCommitsController ) fixup (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
343
343
if self .isRebasing () {
344
- return self .updateTodos (todo .Fixup , selectedCommits )
344
+ return self .updateTodos (todo .Fixup , "" , selectedCommits )
345
345
}
346
346
347
347
self .c .Confirm (types.ConfirmOpts {
@@ -350,7 +350,7 @@ func (self *LocalCommitsController) fixup(selectedCommits []*models.Commit, star
350
350
HandleConfirm : func () error {
351
351
return self .c .WithWaitingStatus (self .c .Tr .FixingStatus , func (gocui.Task ) error {
352
352
self .c .LogAction (self .c .Tr .Actions .FixupCommit )
353
- return self .interactiveRebase (todo .Fixup , startIdx , endIdx )
353
+ return self .interactiveRebase (todo .Fixup , "" , startIdx , endIdx )
354
354
})
355
355
},
356
356
})
@@ -485,14 +485,14 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
485
485
486
486
self .context ().SetSelectionRangeAndMode (selectedIdx , rangeStartIdx , rangeSelectMode )
487
487
488
- return self .updateTodos (todo .Drop , nonUpdateRefTodos )
488
+ return self .updateTodos (todo .Drop , "" , nonUpdateRefTodos )
489
489
},
490
490
})
491
491
492
492
return nil
493
493
}
494
494
495
- return self .updateTodos (todo .Drop , selectedCommits )
495
+ return self .updateTodos (todo .Drop , "" , selectedCommits )
496
496
}
497
497
498
498
isMerge := selectedCommits [0 ].IsMerge ()
@@ -506,7 +506,7 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
506
506
if isMerge {
507
507
return self .dropMergeCommit (startIdx )
508
508
}
509
- return self .interactiveRebase (todo .Drop , startIdx , endIdx )
509
+ return self .interactiveRebase (todo .Drop , "" , startIdx , endIdx )
510
510
})
511
511
},
512
512
})
@@ -521,13 +521,13 @@ func (self *LocalCommitsController) dropMergeCommit(commitIdx int) error {
521
521
522
522
func (self * LocalCommitsController ) edit (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
523
523
if self .isRebasing () {
524
- return self .updateTodos (todo .Edit , selectedCommits )
524
+ return self .updateTodos (todo .Edit , "" , selectedCommits )
525
525
}
526
526
527
527
commits := self .c .Model ().Commits
528
528
if ! commits [endIdx ].IsMerge () {
529
529
selectionRangeAndMode := self .getSelectionRangeAndMode ()
530
- err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit )
530
+ err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit , "" )
531
531
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebaseWithRefreshOptions (
532
532
err ,
533
533
types.RefreshOptions {
@@ -568,7 +568,7 @@ func (self *LocalCommitsController) startInteractiveRebaseWithEdit(
568
568
}
569
569
}
570
570
if len (todos ) > 0 {
571
- err := self .updateTodos (todo .Edit , todos )
571
+ err := self .updateTodos (todo .Edit , "" , todos )
572
572
if err != nil {
573
573
return err
574
574
}
@@ -628,31 +628,31 @@ func (self *LocalCommitsController) findCommitForQuickStartInteractiveRebase() (
628
628
629
629
func (self * LocalCommitsController ) pick (selectedCommits []* models.Commit ) error {
630
630
if self .isRebasing () {
631
- return self .updateTodos (todo .Pick , selectedCommits )
631
+ return self .updateTodos (todo .Pick , "" , selectedCommits )
632
632
}
633
633
634
634
// at this point we aren't actually rebasing so we will interpret this as an
635
635
// attempt to pull. We might revoke this later after enabling configurable keybindings
636
636
return self .pullFiles ()
637
637
}
638
638
639
- func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , startIdx int , endIdx int ) error {
639
+ func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , flag string , startIdx int , endIdx int ) error {
640
640
// When performing an action that will remove the selected commits, we need to select the
641
641
// next commit down (which will end up at the start index after the action is performed)
642
642
if action == todo .Drop || action == todo .Fixup || action == todo .Squash {
643
643
self .context ().SetSelection (startIdx )
644
644
}
645
645
646
- err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action )
646
+ err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action , flag )
647
647
648
648
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebase (err )
649
649
}
650
650
651
651
// updateTodos sees if the selected commit is in fact a rebasing
652
652
// commit meaning you are trying to edit the todo file rather than actually
653
653
// begin a rebase. It then updates the todo file with that action
654
- func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , selectedCommits []* models.Commit ) error {
655
- if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action ); err != nil {
654
+ func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , flag string , selectedCommits []* models.Commit ) error {
655
+ if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action , flag ); err != nil {
656
656
return err
657
657
}
658
658
0 commit comments