diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-27 19:12:15 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:59:45 +1100 |
commit | 198d237679bcc19655138f76a11770c3ef91ec4f (patch) | |
tree | ecc09e91f96baeaf75d437f5fbd00e007d4c6472 /pkg/gui/undoing.go | |
parent | 39315ca1e2f526911ea35d9848b0427093e4080a (diff) |
more centralised handling of refreshing
Diffstat (limited to 'pkg/gui/undoing.go')
-rw-r--r-- | pkg/gui/undoing.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pkg/gui/undoing.go b/pkg/gui/undoing.go index 0fba4b86b..4bdff1421 100644 --- a/pkg/gui/undoing.go +++ b/pkg/gui/undoing.go @@ -87,7 +87,7 @@ func (gui *Gui) reflogUndo(g *gocui.Gui, v *gocui.View) error { undoEnvVars := []string{"GIT_REFLOG_ACTION=[lazygit undo]"} undoingStatus := gui.Tr.SLocalize("UndoingStatus") - if gui.State.WorkingTreeState == "rebasing" { + if gui.workingTreeState() == "rebasing" { return gui.createErrorPanel(gui.g, gui.Tr.SLocalize("cantUndoWhileRebasing")) } @@ -118,7 +118,7 @@ func (gui *Gui) reflogRedo(g *gocui.Gui, v *gocui.View) error { redoEnvVars := []string{"GIT_REFLOG_ACTION=[lazygit redo]"} redoingStatus := gui.Tr.SLocalize("RedoingStatus") - if gui.State.WorkingTreeState == "rebasing" { + if gui.workingTreeState() == "rebasing" { return gui.createErrorPanel(gui.g, gui.Tr.SLocalize("cantRedoWhileRebasing")) } @@ -183,20 +183,17 @@ func (gui *Gui) handleHardResetWithAutoStash(commitSha string, options handleHar } if err := gui.GitCommand.StashDo(0, "pop"); err != nil { - if err := gui.refreshSidePanels(g); err != nil { + if err := gui.refreshSidePanels(refreshOptions{}); err != nil { return err } return gui.createErrorPanel(g, err.Error()) } - return gui.refreshSidePanels(g) + return nil }) }, nil) } return gui.WithWaitingStatus(options.WaitingStatus, func() error { - if err := reset(); err != nil { - return err - } - return gui.refreshSidePanels(gui.g) + return reset() }) } |