From 765b6bd7c425c6642d50cc7bde62f76f78a79377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Fl=C3=BCgge?= Date: Thu, 19 Dec 2024 23:47:59 +0100 Subject: [PATCH] fix: refresh commit view after checkout --- pkg/gui/controllers/helpers/refs_helper.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go index e4f9df3f493..6e0555580e8 100644 --- a/pkg/gui/controllers/helpers/refs_helper.go +++ b/pkg/gui/controllers/helpers/refs_helper.go @@ -278,7 +278,14 @@ func (self *RefsHelper) CreateCheckoutMenu(ref string, branches []*models.Branch LabelColumns: []string{branch.Name}, OnPress: func() error { self.c.LogAction(self.c.Tr.Actions.CheckoutBranch) - return self.c.Git().Branch.Checkout(branch.Name, git_commands.CheckoutOptions{}) + if err := self.c.Git().Branch.Checkout(branch.Name, git_commands.CheckoutOptions{}); err != nil { + return err + } + return self.c.WithWaitingStatus(self.c.Tr.LoadingCommits, func(gocui.Task) error { + return self.c.Refresh( + types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.COMMITS}}, + ) + }) }, Tooltip: self.c.Tr.CheckoutBranchTooltip, }