mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Refresh after creating local branch, before checking it out
This way we see the local branch immediately when switching to the branches view, and we see an inline waiting status on it when checking it out.
This commit is contained in:
@ -144,6 +144,14 @@ func (self *RefsHelper) CheckoutRemoteBranch(fullBranchName string, localBranchN
|
||||
if err := self.c.Git().Branch.CreateWithUpstream(localBranchName, fullBranchName); err != nil {
|
||||
return self.c.Error(err)
|
||||
}
|
||||
// Do a sync refresh to make sure the new branch is visible,
|
||||
// so that we see an inline status when checking it out
|
||||
if err := self.c.Refresh(types.RefreshOptions{
|
||||
Mode: types.SYNC,
|
||||
Scope: []types.RefreshableView{types.BRANCHES},
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return checkout(localBranchName)
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user