mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Disable dropping merge commits if it's not a single selection
This commit is contained in:
parent
bd0d9ef259
commit
d5f2fb6003
2 changed files with 6 additions and 0 deletions
|
@ -1448,6 +1448,10 @@ func (self *LocalCommitsController) midRebaseMoveCommandEnabled(selectedCommits
|
||||||
|
|
||||||
func (self *LocalCommitsController) canDropCommits(selectedCommits []*models.Commit, startIdx int, endIdx int) *types.DisabledReason {
|
func (self *LocalCommitsController) canDropCommits(selectedCommits []*models.Commit, startIdx int, endIdx int) *types.DisabledReason {
|
||||||
if !self.isRebasing() {
|
if !self.isRebasing() {
|
||||||
|
if len(selectedCommits) > 1 && lo.SomeBy(selectedCommits, func(c *models.Commit) bool { return c.IsMerge() }) {
|
||||||
|
return &types.DisabledReason{Text: self.c.Tr.DroppingMergeRequiresSingleSelection}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -322,6 +322,7 @@ type TranslationSet struct {
|
||||||
YouDied string
|
YouDied string
|
||||||
RewordNotSupported string
|
RewordNotSupported string
|
||||||
ChangingThisActionIsNotAllowed string
|
ChangingThisActionIsNotAllowed string
|
||||||
|
DroppingMergeRequiresSingleSelection string
|
||||||
CherryPickCopy string
|
CherryPickCopy string
|
||||||
CherryPickCopyTooltip string
|
CherryPickCopyTooltip string
|
||||||
CherryPickCopyRangeTooltip string
|
CherryPickCopyRangeTooltip string
|
||||||
|
@ -1324,6 +1325,7 @@ func EnglishTranslationSet() *TranslationSet {
|
||||||
YouDied: "YOU DIED!",
|
YouDied: "YOU DIED!",
|
||||||
RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported",
|
RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported",
|
||||||
ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed",
|
ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed",
|
||||||
|
DroppingMergeRequiresSingleSelection: "Dropping a merge commit requires a single selected item",
|
||||||
CherryPickCopy: "Copy (cherry-pick)",
|
CherryPickCopy: "Copy (cherry-pick)",
|
||||||
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.",
|
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.",
|
CherryPickCopyRangeTooltip: "Mark commits as copied from the last copied commit to the selected commit.",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue