diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-03 15:48:01 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-03 15:48:01 +1100 |
commit | e0bdfad63a458513aeadfedc724a040cb6cb0684 (patch) | |
tree | 18c1193db765808d4abb0225b066b211c2b3e61d /pkg/gui/staging_panel.go | |
parent | f07fc31f8ba034981eff6e1adc6a540bb8c64871 (diff) |
don't crash if we have no lines to stage
Diffstat (limited to 'pkg/gui/staging_panel.go')
-rw-r--r-- | pkg/gui/staging_panel.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go index 5d52cf081..a24becbd2 100644 --- a/pkg/gui/staging_panel.go +++ b/pkg/gui/staging_panel.go @@ -1,8 +1,6 @@ package gui import ( - "github.com/go-errors/errors" - "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/git" "github.com/jesseduffield/lazygit/pkg/utils" @@ -60,7 +58,7 @@ func (gui *Gui) refreshStagingPanel() error { } if len(stageableLines) == 0 { - return errors.New("No lines to stage") + return gui.createErrorPanel(gui.g, "No lines to stage") } if err := gui.focusLineAndHunk(); err != nil { |