@@ -306,7 +306,7 @@ func secondaryPatchPanelUpdateOpts(c *ControllerCommon) *types.ViewUpdateOpts {
306
306
307
307
func (self * LocalCommitsController ) squashDown (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
308
308
if self .isRebasing () {
309
- return self .updateTodos (todo .Squash , selectedCommits )
309
+ return self .updateTodos (todo .Squash , "" , selectedCommits )
310
310
}
311
311
312
312
self .c .Confirm (types.ConfirmOpts {
@@ -315,7 +315,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
315
315
HandleConfirm : func () error {
316
316
return self .c .WithWaitingStatus (self .c .Tr .SquashingStatus , func (gocui.Task ) error {
317
317
self .c .LogAction (self .c .Tr .Actions .SquashCommitDown )
318
- return self .interactiveRebase (todo .Squash , startIdx , endIdx )
318
+ return self .interactiveRebase (todo .Squash , "" , startIdx , endIdx )
319
319
})
320
320
},
321
321
})
@@ -325,7 +325,7 @@ func (self *LocalCommitsController) squashDown(selectedCommits []*models.Commit,
325
325
326
326
func (self * LocalCommitsController ) fixup (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
327
327
if self .isRebasing () {
328
- return self .updateTodos (todo .Fixup , selectedCommits )
328
+ return self .updateTodos (todo .Fixup , "" , selectedCommits )
329
329
}
330
330
331
331
self .c .Confirm (types.ConfirmOpts {
@@ -334,7 +334,7 @@ func (self *LocalCommitsController) fixup(selectedCommits []*models.Commit, star
334
334
HandleConfirm : func () error {
335
335
return self .c .WithWaitingStatus (self .c .Tr .FixingStatus , func (gocui.Task ) error {
336
336
self .c .LogAction (self .c .Tr .Actions .FixupCommit )
337
- return self .interactiveRebase (todo .Fixup , startIdx , endIdx )
337
+ return self .interactiveRebase (todo .Fixup , "" , startIdx , endIdx )
338
338
})
339
339
},
340
340
})
@@ -469,14 +469,14 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
469
469
470
470
self .context ().SetSelectionRangeAndMode (selectedIdx , rangeStartIdx , rangeSelectMode )
471
471
472
- return self .updateTodos (todo .Drop , nonUpdateRefTodos )
472
+ return self .updateTodos (todo .Drop , "" , nonUpdateRefTodos )
473
473
},
474
474
})
475
475
476
476
return nil
477
477
}
478
478
479
- return self .updateTodos (todo .Drop , selectedCommits )
479
+ return self .updateTodos (todo .Drop , "" , selectedCommits )
480
480
}
481
481
482
482
isMerge := selectedCommits [0 ].IsMerge ()
@@ -490,7 +490,7 @@ func (self *LocalCommitsController) drop(selectedCommits []*models.Commit, start
490
490
if isMerge {
491
491
return self .dropMergeCommit (startIdx )
492
492
}
493
- return self .interactiveRebase (todo .Drop , startIdx , endIdx )
493
+ return self .interactiveRebase (todo .Drop , "" , startIdx , endIdx )
494
494
})
495
495
},
496
496
})
@@ -505,13 +505,13 @@ func (self *LocalCommitsController) dropMergeCommit(commitIdx int) error {
505
505
506
506
func (self * LocalCommitsController ) edit (selectedCommits []* models.Commit , startIdx int , endIdx int ) error {
507
507
if self .isRebasing () {
508
- return self .updateTodos (todo .Edit , selectedCommits )
508
+ return self .updateTodos (todo .Edit , "" , selectedCommits )
509
509
}
510
510
511
511
commits := self .c .Model ().Commits
512
512
if ! commits [endIdx ].IsMerge () {
513
513
selectionRangeAndMode := self .getSelectionRangeAndMode ()
514
- err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit )
514
+ err := self .c .Git ().Rebase .InteractiveRebase (commits , startIdx , endIdx , todo .Edit , "" )
515
515
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebaseWithRefreshOptions (
516
516
err ,
517
517
types.RefreshOptions {
@@ -552,7 +552,7 @@ func (self *LocalCommitsController) startInteractiveRebaseWithEdit(
552
552
}
553
553
}
554
554
if len (todos ) > 0 {
555
- err := self .updateTodos (todo .Edit , todos )
555
+ err := self .updateTodos (todo .Edit , "" , todos )
556
556
if err != nil {
557
557
return err
558
558
}
@@ -612,29 +612,29 @@ func (self *LocalCommitsController) findCommitForQuickStartInteractiveRebase() (
612
612
613
613
func (self * LocalCommitsController ) pick (selectedCommits []* models.Commit ) error {
614
614
if self .isRebasing () {
615
- return self .updateTodos (todo .Pick , selectedCommits )
615
+ return self .updateTodos (todo .Pick , "" , selectedCommits )
616
616
}
617
617
618
618
panic ("should be disabled when not rebasing" )
619
619
}
620
620
621
- func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , startIdx int , endIdx int ) error {
621
+ func (self * LocalCommitsController ) interactiveRebase (action todo.TodoCommand , flag string , startIdx int , endIdx int ) error {
622
622
// When performing an action that will remove the selected commits, we need to select the
623
623
// next commit down (which will end up at the start index after the action is performed)
624
624
if action == todo .Drop || action == todo .Fixup || action == todo .Squash {
625
625
self .context ().SetSelection (startIdx )
626
626
}
627
627
628
- err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action )
628
+ err := self .c .Git ().Rebase .InteractiveRebase (self .c .Model ().Commits , startIdx , endIdx , action , flag )
629
629
630
630
return self .c .Helpers ().MergeAndRebase .CheckMergeOrRebase (err )
631
631
}
632
632
633
633
// updateTodos sees if the selected commit is in fact a rebasing
634
634
// commit meaning you are trying to edit the todo file rather than actually
635
635
// begin a rebase. It then updates the todo file with that action
636
- func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , selectedCommits []* models.Commit ) error {
637
- if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action ); err != nil {
636
+ func (self * LocalCommitsController ) updateTodos (action todo.TodoCommand , flag string , selectedCommits []* models.Commit ) error {
637
+ if err := self .c .Git ().Rebase .EditRebaseTodo (selectedCommits , action , flag ); err != nil {
638
638
return err
639
639
}
640
640
0 commit comments