summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-03-16 10:06:53 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-03-17 07:53:38 +0100
commit6932e0470812dda75923de75dd1d5183859a0795 (patch)
tree512eeda664c120530845666a4f119d287fb95eb1
parent30db7234d9dae642a5643fd050dbb25ed3aff55e (diff)
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.
-rw-r--r--pkg/gui/controllers/helpers/refs_helper.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go
index dd7ae839a..6ddff118c 100644
--- a/pkg/gui/controllers/helpers/refs_helper.go
+++ b/pkg/gui/controllers/helpers/refs_helper.go
@@ -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)
},
},