Refactor to tighten interface to lazygit daemon

This commit is contained in:
Jesse Duffield 2023-04-16 15:43:54 +10:00 committed by Stefan Haller
parent a8586ba57e
commit 185bbf0c75
5 changed files with 331 additions and 223 deletions

View file

@ -105,15 +105,16 @@ func (self *PatchCommands) MovePatchToSelectedCommit(commits []*models.Commit, s
baseIndex := sourceCommitIdx + 1
changes := []daemon.ChangeTodoAction{
{Sha: commits[sourceCommitIdx].Sha, NewAction: todo.Edit},
{Sha: commits[destinationCommitIdx].Sha, NewAction: todo.Edit},
}
self.os.LogCommand(logTodoChanges(changes), false)
err := self.rebase.PrepareInteractiveRebaseCommand(PrepareInteractiveRebaseCommandOpts{
baseShaOrRoot: commits[baseIndex].Sha,
overrideEditor: true,
instruction: ChangeTodoActionsInstruction{
actions: []daemon.ChangeTodoAction{
{Sha: commits[sourceCommitIdx].Sha, NewAction: todo.Edit},
{Sha: commits[destinationCommitIdx].Sha, NewAction: todo.Edit},
},
},
instruction: daemon.NewChangeTodoActionsInstruction(changes),
}).Run()
if err != nil {
return err