Skip to content

Commit

Permalink
fix: refresh commit view after checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Flügge committed Dec 19, 2024
1 parent f2ba86c commit 818515a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/gui/controllers/helpers/refs_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 818515a

Please sign in to comment.