mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
Add DisabledReason for discarding from a multiselection of commits
This commit is contained in:
parent
35d06c32d7
commit
b3d81a0c7c
|
|
@ -351,6 +351,13 @@ func (self *CommitFilesController) canDiscardFileChanges(nodes []*filetree.Commi
|
|||
}
|
||||
}
|
||||
|
||||
if self.c.Contexts().LocalCommits.AreMultipleItemsSelected() {
|
||||
return &types.DisabledReason{
|
||||
Text: self.c.Tr.CannotDiscardFromMultipleCommits,
|
||||
ShowErrorInPanel: true,
|
||||
}
|
||||
}
|
||||
|
||||
if self.c.Git().Status.WorkingTreeState().Any() {
|
||||
return &types.DisabledReason{
|
||||
Text: self.c.Tr.CantPatchWhileRebasingError,
|
||||
|
|
|
|||
|
|
@ -434,6 +434,7 @@ type TranslationSet struct {
|
|||
CheckoutCommitFileTooltip string
|
||||
CannotCheckoutWithModifiedFilesErr string
|
||||
CanOnlyDiscardFromLocalCommits string
|
||||
CannotDiscardFromMultipleCommits string
|
||||
Remove string
|
||||
DiscardOldFileChangeTooltip string
|
||||
DiscardFileChangesTitle string
|
||||
|
|
@ -1543,6 +1544,7 @@ func EnglishTranslationSet() *TranslationSet {
|
|||
CheckoutCommitFileTooltip: "Checkout file. This replaces the file in your working tree with the version from the selected commit.",
|
||||
CannotCheckoutWithModifiedFilesErr: "You have local modifications for the file(s) you are trying to check out. You need to stash or discard these first.",
|
||||
CanOnlyDiscardFromLocalCommits: "Changes can only be discarded from local commits",
|
||||
CannotDiscardFromMultipleCommits: "Changes cannot be discarded from a multiselection of commits",
|
||||
Remove: "Remove",
|
||||
DiscardOldFileChangeTooltip: "Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file.",
|
||||
DiscardFileChangesTitle: "Discard file changes",
|
||||
|
|
|
|||
Loading…
Reference in a new issue