Skip to content

Commit d4a4fb3

Browse files
committed
Remove unused cherry-picking code in daemon
1 parent 152d8a0 commit d4a4fb3

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

Diff for: pkg/app/daemon/daemon.go

-36
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"os/exec"
99
"strconv"
1010

11-
"github.com/jesseduffield/lazygit/pkg/commands/models"
1211
"github.com/jesseduffield/lazygit/pkg/common"
1312
"github.com/jesseduffield/lazygit/pkg/utils"
1413
"github.com/samber/lo"
@@ -33,7 +32,6 @@ const (
3332

3433
DaemonKindExitImmediately
3534
DaemonKindRemoveUpdateRefsForCopiedBranch
36-
DaemonKindCherryPick
3735
DaemonKindMoveTodosUp
3836
DaemonKindMoveTodosDown
3937
DaemonKindInsertBreak
@@ -56,7 +54,6 @@ func getInstruction() Instruction {
5654
mapping := map[DaemonKind]func(string) Instruction{
5755
DaemonKindExitImmediately: deserializeInstruction[*ExitImmediatelyInstruction],
5856
DaemonKindRemoveUpdateRefsForCopiedBranch: deserializeInstruction[*RemoveUpdateRefsForCopiedBranchInstruction],
59-
DaemonKindCherryPick: deserializeInstruction[*CherryPickCommitsInstruction],
6057
DaemonKindChangeTodoActions: deserializeInstruction[*ChangeTodoActionsInstruction],
6158
DaemonKindDropMergeCommit: deserializeInstruction[*DropMergeCommitInstruction],
6259
DaemonKindMoveFixupCommitDown: deserializeInstruction[*MoveFixupCommitDownInstruction],
@@ -180,39 +177,6 @@ func NewRemoveUpdateRefsForCopiedBranchInstruction() Instruction {
180177
return &RemoveUpdateRefsForCopiedBranchInstruction{}
181178
}
182179

183-
type CherryPickCommitsInstruction struct {
184-
Todo string
185-
}
186-
187-
func NewCherryPickCommitsInstruction(commits []*models.Commit) Instruction {
188-
todoLines := lo.Map(commits, func(commit *models.Commit, _ int) TodoLine {
189-
return TodoLine{
190-
Action: "pick",
191-
Commit: commit,
192-
}
193-
})
194-
195-
todo := TodoLinesToString(todoLines)
196-
197-
return &CherryPickCommitsInstruction{
198-
Todo: todo,
199-
}
200-
}
201-
202-
func (self *CherryPickCommitsInstruction) Kind() DaemonKind {
203-
return DaemonKindCherryPick
204-
}
205-
206-
func (self *CherryPickCommitsInstruction) SerializedInstructions() string {
207-
return serializeInstruction(self)
208-
}
209-
210-
func (self *CherryPickCommitsInstruction) run(common *common.Common) error {
211-
return handleInteractiveRebase(common, func(path string) error {
212-
return utils.PrependStrToTodoFile(path, []byte(self.Todo))
213-
})
214-
}
215-
216180
type ChangeTodoActionsInstruction struct {
217181
Changes []ChangeTodoAction
218182
}

0 commit comments

Comments
 (0)