1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Add number of commits to cherry-pick confirmation prompt

This commit is contained in:
Brandon
2025-01-08 20:25:24 -08:00
parent 3518ec9f72
commit c44231a7d7
8 changed files with 17 additions and 10 deletions

View File

@ -1,10 +1,13 @@
package helpers
import (
"strconv"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/modes/cherrypicking"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/samber/lo"
)
@ -67,8 +70,12 @@ func (self *CherryPickHelper) CopyRange(commitsList []*models.Commit, context ty
// Only to be called from the branch commits controller
func (self *CherryPickHelper) Paste() error {
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.CherryPick,
Prompt: self.c.Tr.SureCherryPick,
Title: self.c.Tr.CherryPick,
Prompt: utils.ResolvePlaceholderString(
self.c.Tr.SureCherryPick,
map[string]string{
"numCommits": strconv.Itoa(len(self.getData().CherryPickedCommits)),
}),
HandleConfirm: func() error {
isInRebase, err := self.c.Git().Status.IsInInteractiveRebase()
if err != nil {