1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-30 09:16:47 +02:00

don't crash if we have no lines to stage

This commit is contained in:
Jesse Duffield 2019-03-03 15:48:01 +11:00
parent f07fc31f8b
commit e0bdfad63a

View File

@ -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 {