Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pkg/gui/controllers/helpers/cherry_pick_helper.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/i18n/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ func EnglishTranslationSet() *TranslationSet {
CherryPickCopyTooltip: "Mark commit as copied. Then, within the local commits view, you can press `{{.paste}}` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `{{.escape}}` to cancel the selection.",
CherryPickCopyRangeTooltip: "Mark commits as copied from the last copied commit to the selected commit.",
PasteCommits: "Paste (cherry-pick)",
SureCherryPick: "Are you sure you want to cherry-pick the copied commits onto this branch?",
SureCherryPick: "Are you sure you want to cherry-pick the {{.numCommits}} copied commit(s) onto this branch?",
CherryPick: "Cherry-pick",
CannotCherryPickNonCommit: "Cannot cherry-pick this kind of todo item",
CannotCherryPickMergeCommit: "Cherry-picking merge commits is not supported",
Expand Down
4 changes: 2 additions & 2 deletions pkg/integration/tests/cherry_pick/cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 2 copied commit(s) onto this branch?")).
Confirm()
}).
Tap(func() {
Expand Down Expand Up @@ -95,7 +95,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 2 copied commit(s) onto this branch?")).
Confirm()
}).
Tap(func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{

t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 2 copied commit(s) onto this branch?")).
Confirm()

t.Common().AcknowledgeConflicts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 1 copied commit(s) onto this branch?")).
Confirm()
}).
Tap(func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/integration/tests/cherry_pick/cherry_pick_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var CherryPickRange = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 2 copied commit(s) onto this branch?")).
Confirm()
}).
Tap(func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/integration/tests/demo/cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
t.Wait(1000)
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 2 copied commit(s) onto this branch?")).
Confirm()
}).
TopLines(
Expand Down
2 changes: 1 addition & 1 deletion pkg/integration/tests/reflog/cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Alert().
Title(Equals("Cherry-pick")).
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Content(Contains("Are you sure you want to cherry-pick the 1 copied commit(s) onto this branch?")).
Confirm()
}).
Lines(
Expand Down
Loading