1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-31 23:19:40 +02:00

no need to invoke sync controller here

This commit is contained in:
Jesse Duffield 2022-01-30 11:01:32 +11:00
parent 55b393c929
commit b04038d08f

View File

@ -306,12 +306,29 @@ func (gui *Gui) handleFastForward() error {
) )
return gui.c.WithLoaderPanel(message, func() error { return gui.c.WithLoaderPanel(message, func() error {
gui.c.LogAction(action) if gui.State.Panels.Branches.SelectedLineIdx == 0 {
err := gui.git.Sync.FastForward(branch.Name, branch.UpstreamRemote, branch.UpstreamBranch) gui.c.LogAction(action)
if err != nil {
_ = gui.c.Error(err) err := gui.git.Sync.Pull(
git_commands.PullOptions{
RemoteName: branch.UpstreamRemote,
BranchName: branch.Name,
FastForwardOnly: true,
},
)
if err != nil {
_ = gui.c.Error(err)
}
return gui.c.Refresh(types.RefreshOptions{Mode: types.ASYNC})
} else {
gui.c.LogAction(action)
err := gui.git.Sync.FastForward(branch.Name, branch.UpstreamRemote, branch.UpstreamBranch)
if err != nil {
_ = gui.c.Error(err)
}
_ = gui.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.BRANCHES}})
} }
_ = gui.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.BRANCHES}})
return nil return nil
}) })