mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
no need to invoke sync controller here
This commit is contained in:
parent
55b393c929
commit
b04038d08f
|
|
@ -306,12 +306,29 @@ func (gui *Gui) handleFastForward() error {
|
|||
)
|
||||
|
||||
return gui.c.WithLoaderPanel(message, func() error {
|
||||
gui.c.LogAction(action)
|
||||
err := gui.git.Sync.FastForward(branch.Name, branch.UpstreamRemote, branch.UpstreamBranch)
|
||||
if err != nil {
|
||||
_ = gui.c.Error(err)
|
||||
if gui.State.Panels.Branches.SelectedLineIdx == 0 {
|
||||
gui.c.LogAction(action)
|
||||
|
||||
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
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue