1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Cleanup: get rid of the variadic parameter of ContextMgr.Push

Apparently this was an attempt at working around go's lack of default arguments,
but it's very unidiomatic and a bit confusing. Make it a normal parameter
instead, so all clients have to pass it explicitly.
This commit is contained in:
Stefan Haller
2024-10-10 14:35:28 +02:00
parent 9c98fd809c
commit b3215a750c
29 changed files with 36 additions and 46 deletions

View File

@ -118,7 +118,7 @@ func (self *RefsHelper) CheckoutRemoteBranch(fullBranchName string, localBranchN
// Switch to the branches context _before_ starting to check out the
// branch, so that we see the inline status
if self.c.Context().Current() != self.c.Contexts().Branches {
self.c.Context().Push(self.c.Contexts().Branches)
self.c.Context().Push(self.c.Contexts().Branches, types.OnFocusOpts{})
}
return self.CheckoutRef(branchName, types.CheckoutRefOptions{})
}
@ -334,7 +334,7 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest
refresh := func() error {
if self.c.Context().Current() != self.c.Contexts().Branches {
self.c.Context().Push(self.c.Contexts().Branches)
self.c.Context().Push(self.c.Contexts().Branches, types.OnFocusOpts{})
}
self.c.Contexts().LocalCommits.SetSelection(0)