mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-21 12:16:54 +02:00
Disable moving merge commits
Not much of a change in behavior, because moving merge commits was already not possible. However, it failed with a cryptic error message ("Todo fa1afe1 not found in git-rebase-todo"), so disable it properly instead.
This commit is contained in:
parent
13e9e1de83
commit
75d2fb1df2
@ -1420,6 +1420,10 @@ func (self *LocalCommitsController) midRebaseCommandEnabled(selectedCommits []*m
|
||||
// Ensures that if we are mid-rebase, we're only selecting commits that can be moved
|
||||
func (self *LocalCommitsController) midRebaseMoveCommandEnabled(selectedCommits []*models.Commit, startIdx int, endIdx int) *types.DisabledReason {
|
||||
if !self.isRebasing() {
|
||||
if lo.SomeBy(selectedCommits, func(c *models.Commit) bool { return c.IsMerge() }) {
|
||||
return &types.DisabledReason{Text: self.c.Tr.CannotMoveMergeCommit}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,7 @@ type TranslationSet struct {
|
||||
MoveDownCommit string
|
||||
MoveUpCommit string
|
||||
CannotMoveAnyFurther string
|
||||
CannotMoveMergeCommit string
|
||||
EditCommit string
|
||||
EditCommitTooltip string
|
||||
AmendCommitTooltip string
|
||||
@ -1153,6 +1154,7 @@ func EnglishTranslationSet() *TranslationSet {
|
||||
MoveDownCommit: "Move commit down one",
|
||||
MoveUpCommit: "Move commit up one",
|
||||
CannotMoveAnyFurther: "Cannot move any further",
|
||||
CannotMoveMergeCommit: "Cannot move a merge commit",
|
||||
EditCommit: "Edit (start interactive rebase)",
|
||||
EditCommitTooltip: "Edit the selected commit. Use this to start an interactive rebase from the selected commit. When already mid-rebase, this will mark the selected commit for editing, which means that upon continuing the rebase, the rebase will pause at the selected commit to allow you to make changes.",
|
||||
AmendCommitTooltip: "Amend commit with staged changes. If the selected commit is the HEAD commit, this will perform `git commit --amend`. Otherwise the commit will be amended via a rebase.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user