@@ -314,7 +314,7 @@ func secondaryPatchPanelUpdateOpts(c *ControllerCommon) *types.ViewUpdateOpts {
314
314
315
315
func (self * LocalCommitsController ) squashDown (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
316
316
if self .isRebasing () {
317
- return self .updateTodos (todo .Squash , selectedCommits )
317
+ return self .updateTodos (todo .Squash , "" , selectedCommits )
318
318
}
319
319
320
320
self .c .Confirm (types.ConfirmOpts {
@@ -323,7 +323,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
323
323
HandleConfirm : func () error {
324
324
return self .c .WithWaitingStatus (self .c .Tr .SquashingStatus , func (gocui.Task ) error {
325
325
self .c .LogAction (self .c .Tr .Actions .SquashCommitDown )
326
- return self .interactiveRebase (todo .Squash , startIdx , endIdx )
326
+ return self .interactiveRebase (todo .Squash , "" , startIdx , endIdx )
327
327
})
328
328
},
329
329
})
@@ -333,7 +333,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
333
333
334
334
func (self * LocalCommitsController ) fixup (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
335
335
if self .isRebasing () {
336
- return self .updateTodos (todo .Fixup , selectedCommits )
336
+ return self .updateTodos (todo .Fixup , "" , selectedCommits )
337
337
}
338
338
339
339
self .c .Confirm (types.ConfirmOpts {
@@ -342,7 +342,7 @@ func (self *LocalCommitsController) fixup(selectedCommits []*models.Commit, star
342
342
HandleConfirm : func () error {
343
343
return self .c .WithWaitingStatus (self .c .Tr .FixingStatus , func (gocui.Task ) error {
344
344
self .c .LogAction (self .c .Tr .Actions .FixupCommit )
345
- return self .interactiveRebase (todo .Fixup , startIdx , endIdx )
345
+ return self .interactiveRebase (todo .Fixup , "" , startIdx , endIdx )
346
346
})
347
347
},
348
348
})
@@ -477,14 +477,14 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
477
477
478
478
self .context ().SetSelectionRangeAndMode (selectedIdx , rangeStartIdx , rangeSelectMode )
479
479
480
- return self .updateTodos (todo .Drop , nonUpdateRefTodos )
480
+ return self .updateTodos (todo .Drop , "" , nonUpdateRefTodos )
481
481
},
482
482
})
483
483
484
484
return nil
485
485
}
486
486
487
- return self .updateTodos (todo .Drop , selectedCommits )
487
+ return self .updateTodos (todo .Drop , "" , selectedCommits )
488
488
}
489
489
490
490
isMerge := selectedCommits [0 ].IsMerge ()
@@ -498,7 +498,7 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
498
498
if isMerge {
499
499
return self .dropMergeCommit (startIdx )
500
500
}
501
- return self .interactiveRebase (todo .Drop , startIdx , endIdx )
501
+ return self .interactiveRebase (todo .Drop , "" , startIdx , endIdx )
502
502
})
503
503
},
504
504
})
@@ -513,13 +513,13 @@ func (self *LocalCommitsController) dropMergeCommit(commitIdx int) error {
513
513
514
514
func (self * LocalCommitsController ) edit (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
515
515
if self .isRebasing () {
516
- return self .updateTodos (todo .Edit , selectedCommits )
516
+ return self .updateTodos (todo .Edit , "" , selectedCommits )
517
517
}
518
518
519
519
commits := self .c .Model ().Commits
520
520
if ! commits [endIdx ].IsMerge () {
521
521
selectionRangeAndMode := self .getSelectionRangeAndMode ()
522
- err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit )
522
+ err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit , "" )
523
523
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebaseWithRefreshOptions (
524
524
err ,
525
525
types.RefreshOptions {
@@ -560,7 +560,7 @@ func (self *LocalCommitsController) startInteractiveRebaseWithEdit(
560
560
}
561
561
}
562
562
if len (todos ) > 0 {
563
- err := self .updateTodos (todo .Edit , todos )
563
+ err := self .updateTodos (todo .Edit , "" , todos )
564
564
if err != nil {
565
565
return err
566
566
}
@@ -620,31 +620,31 @@ func (self *LocalCommitsController) findCommitForQuickStartInteractiveRebase() (
620
620
621
621
func (self * LocalCommitsController ) pick (selectedCommits []* models.Commit ) error {
622
622
if self .isRebasing () {
623
- return self .updateTodos (todo .Pick , selectedCommits )
623
+ return self .updateTodos (todo .Pick , "" , selectedCommits )
624
624
}
625
625
626
626
// at this point we aren't actually rebasing so we will interpret this as an
627
627
// attempt to pull. We might revoke this later after enabling configurable keybindings
628
628
return self .pullFiles ()
629
629
}
630
630
631
- func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , startIdx int , endIdx int ) error {
631
+ func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , flag string , startIdx int , endIdx int ) error {
632
632
// When performing an action that will remove the selected commits, we need to select the
633
633
// next commit down (which will end up at the start index after the action is performed)
634
634
if action == todo .Drop || action == todo .Fixup || action == todo .Squash {
635
635
self .context ().SetSelection (startIdx )
636
636
}
637
637
638
- err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action )
638
+ err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action , flag )
639
639
640
640
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebase (err )
641
641
}
642
642
643
643
// updateTodos sees if the selected commit is in fact a rebasing
644
644
// commit meaning you are trying to edit the todo file rather than actually
645
645
// begin a rebase. It then updates the todo file with that action
646
- func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , selectedCommits []* models.Commit ) error {
647
- if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action ); err != nil {
646
+ func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , flag string , selectedCommits []* models.Commit ) error {
647
+ if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action , flag ); err != nil {
648
648
return err
649
649
}
650
650
0 commit comments