mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-02 22:25:47 +02: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…
x
Reference in New Issue
Block a user