From 82fe4aa6c0e24852f4c73030447fdd99deda5e66 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 31 Mar 2021 23:05:16 +1100 Subject: [PATCH] disallow editing commit file directory --- pkg/gui/commit_files_panel.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go index 511d31b3d..d0c0228ec 100644 --- a/pkg/gui/commit_files_panel.go +++ b/pkg/gui/commit_files_panel.go @@ -129,6 +129,10 @@ func (gui *Gui) handleEditCommitFile(g *gocui.Gui, v *gocui.View) error { return nil } + if node.File == nil { + return gui.createErrorPanel(gui.Tr.ErrCannotEditDirectory) + } + return gui.editFile(node.GetPath()) }