diff --git a/pkg/commands/git_commands/patch.go b/pkg/commands/git_commands/patch.go index 8c956529c..a09f9bce6 100644 --- a/pkg/commands/git_commands/patch.go +++ b/pkg/commands/git_commands/patch.go @@ -3,6 +3,7 @@ package git_commands import ( "fmt" + "github.com/fsmiamoto/git-todo-parser/todo" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/patch" @@ -103,18 +104,13 @@ func (self *PatchCommands) MovePatchToSelectedCommit(commits []*models.Commit, s baseIndex := sourceCommitIdx + 1 - todoLines := self.rebase.BuildTodoLines(commits[0:baseIndex], func(commit *models.Commit, i int) string { - if i == sourceCommitIdx || i == destinationCommitIdx { - return "edit" - } else { - return "pick" - } - }) - err := self.rebase.PrepareInteractiveRebaseCommand(PrepareInteractiveRebaseCommandOpts{ baseShaOrRoot: commits[baseIndex].Sha, - todoLines: todoLines, overrideEditor: true, + changeTodoActions: []ChangeTodoAction{ + {sha: commits[sourceCommitIdx].Sha, newAction: todo.Edit}, + {sha: commits[destinationCommitIdx].Sha, newAction: todo.Edit}, + }, }).Run() if err != nil { return err