mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-21 00:30:00 +02:00
Show error when trying to open patch menu with an empty patch (#2829)
This commit is contained in:
@ -18,6 +18,10 @@ func (self *CustomPatchOptionsMenuAction) Call() error {
|
|||||||
return self.c.ErrorMsg(self.c.Tr.NoPatchError)
|
return self.c.ErrorMsg(self.c.Tr.NoPatchError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.c.Git().Patch.PatchBuilder.IsEmpty() {
|
||||||
|
return self.c.ErrorMsg(self.c.Tr.EmptyPatchError)
|
||||||
|
}
|
||||||
|
|
||||||
menuItems := []*types.MenuItem{
|
menuItems := []*types.MenuItem{
|
||||||
{
|
{
|
||||||
Label: self.c.Tr.ResetPatch,
|
Label: self.c.Tr.ResetPatch,
|
||||||
|
@ -323,6 +323,7 @@ type TranslationSet struct {
|
|||||||
ViewPatchOptions string
|
ViewPatchOptions string
|
||||||
PatchOptionsTitle string
|
PatchOptionsTitle string
|
||||||
NoPatchError string
|
NoPatchError string
|
||||||
|
EmptyPatchError string
|
||||||
EnterFile string
|
EnterFile string
|
||||||
ExitCustomPatchBuilder string
|
ExitCustomPatchBuilder string
|
||||||
EnterUpstream string
|
EnterUpstream string
|
||||||
@ -1017,6 +1018,7 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
ViewPatchOptions: "View custom patch options",
|
ViewPatchOptions: "View custom patch options",
|
||||||
PatchOptionsTitle: "Patch options",
|
PatchOptionsTitle: "Patch options",
|
||||||
NoPatchError: "No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines",
|
NoPatchError: "No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines",
|
||||||
|
EmptyPatchError: "Patch is still empty. Add some files or lines to your patch first.",
|
||||||
EnterFile: "Enter file to add selected lines to the patch (or toggle directory collapsed)",
|
EnterFile: "Enter file to add selected lines to the patch (or toggle directory collapsed)",
|
||||||
ExitCustomPatchBuilder: `Exit custom patch builder`,
|
ExitCustomPatchBuilder: `Exit custom patch builder`,
|
||||||
EnterUpstream: `Enter upstream as '<remote> <branchname>'`,
|
EnterUpstream: `Enter upstream as '<remote> <branchname>'`,
|
||||||
|
Reference in New Issue
Block a user