summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-02-10 11:27:18 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-02-10 11:27:28 +0100
commitbc6616d5117b7a660b58bc67ab74cb7adc64cb10 (patch)
tree235d9bd7f320e0311f47470de6bdae0f0b57460a
parent2c82b3f8dd4cbbec78bea4e621a4c3369e2c92aa (diff)
Disallow cherry-picking merge commits
-rw-r--r--pkg/gui/controllers/basic_commits_controller.go4
-rw-r--r--pkg/i18n/english.go2
2 files changed, 6 insertions, 0 deletions
diff --git a/pkg/gui/controllers/basic_commits_controller.go b/pkg/gui/controllers/basic_commits_controller.go
index d2e494991..a589e3828 100644
--- a/pkg/gui/controllers/basic_commits_controller.go
+++ b/pkg/gui/controllers/basic_commits_controller.go
@@ -298,6 +298,10 @@ func (self *BasicCommitsController) canCopyCommits(selectedCommits []*models.Com
if commit.Sha == "" {
return &types.DisabledReason{Text: self.c.Tr.CannotCherryPickNonCommit, ShowErrorInPanel: true}
}
+
+ if commit.IsMerge() {
+ return &types.DisabledReason{Text: self.c.Tr.CannotCherryPickMergeCommit, ShowErrorInPanel: true}
+ }
}
return nil
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 8f54e4bd6..048f0e6c4 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -303,6 +303,7 @@ type TranslationSet struct {
SureCherryPick string
CherryPick string
CannotCherryPickNonCommit string
+ CannotCherryPickMergeCommit string
Donate string
AskQuestion string
PrevLine string
@@ -1244,6 +1245,7 @@ func EnglishTranslationSet() TranslationSet {
SureCherryPick: "Are you sure you want to cherry-pick the copied commits onto this branch?",
CherryPick: "Cherry-pick",
CannotCherryPickNonCommit: "Cannot cherry-pick this kind of todo item",
+ CannotCherryPickMergeCommit: "Cherry-picking merge commits is not supported",
Donate: "Donate",
AskQuestion: "Ask Question",
PrevLine: "Select previous line",