diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-18 20:53:46 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-18 23:07:38 +1100 |
commit | 66e6369c284e96ed5af5b6d178b9270f59b99e56 (patch) | |
tree | ae234052296c51cf8c2d4b7c6a2b20ce34f13af0 /pkg/gui | |
parent | 0f0da9c32a0a8ced0f88128e091452ba0478eea9 (diff) |
allow fastforwarding the current branchv0.14.4
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/branches_panel.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index e4e7a432f..a683a2342 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -372,12 +372,19 @@ func (gui *Gui) handleFastForward(g *gocui.Gui, v *gocui.View) error { go func() { _ = gui.createLoaderPanel(gui.g, v, message) - if err := gui.GitCommand.FastForward(branch.Name, remoteName, remoteBranchName); err != nil { - _ = gui.createErrorPanel(gui.g, err.Error()) + if gui.State.Panels.Branches.SelectedLine == 0 { + if err := gui.GitCommand.PullWithoutPasswordCheck("--ff-only"); err != nil { + _ = gui.createErrorPanel(gui.g, err.Error()) + } + _ = gui.refreshSidePanels(gui.g) } else { - _ = gui.closeConfirmationPrompt(gui.g, true) + if err := gui.GitCommand.FastForward(branch.Name, remoteName, remoteBranchName); err != nil { + _ = gui.createErrorPanel(gui.g, err.Error()) + } _ = gui.RenderSelectedBranchUpstreamDifferences() } + + _ = gui.closeConfirmationPrompt(gui.g, true) }() return nil } |