mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02: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:
parent
30db7234d9
commit
6932e04708
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue