1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Show error when trying to open patch menu with an empty patch

This commit is contained in:
Stefan Haller
2023-07-26 10:08:52 +02:00
parent decb055df9
commit 67a7293e79
2 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,10 @@ func (self *CustomPatchOptionsMenuAction) Call() error {
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{
{
Label: self.c.Tr.ResetPatch,