feat: allow to perform a rebase with breaking before the first commit

This commit is contained in:
AzraelSec 2023-03-29 00:53:14 +02:00 committed by Jesse Duffield
parent 368f9c8cb3
commit a3fdf91714
7 changed files with 40 additions and 22 deletions

View file

@ -126,6 +126,11 @@ func (self *RebaseCommands) InteractiveRebaseBreakAfter(commits []*models.Commit
return self.PrepareInteractiveRebaseCommand(sha, todo, true, false).Run()
}
func (self *RebaseCommands) EditRebase(branchRef string) error {
commands := []TodoLine{{Action: "break"}}
return self.PrepareInteractiveRebaseCommand(branchRef, commands, false, true).Run()
}
// PrepareInteractiveRebaseCommand returns the cmd for an interactive rebase
// we tell git to run lazygit to edit the todo list, and we pass the client
// lazygit a todo string to write to the todo file