mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Add mutex for refreshing branches
We had a race condition due to refreshing branches in two different places, one which refreshed reflog commits beforehand. The race condition meant that upon load we wouldn't see recency values (provided by the reflog commits) against the branches
This commit is contained in:
@ -342,6 +342,9 @@ func (self *RefreshHelper) refreshStateSubmoduleConfigs() error {
|
||||
// self.refreshStatus is called at the end of this because that's when we can
|
||||
// be sure there is a State.Model.Branches array to pick the current branch from
|
||||
func (self *RefreshHelper) refreshBranches() {
|
||||
self.c.Mutexes().RefreshingBranchesMutex.Lock()
|
||||
defer self.c.Mutexes().RefreshingBranchesMutex.Unlock()
|
||||
|
||||
reflogCommits := self.c.Model().FilteredReflogCommits
|
||||
if self.c.Modes().Filtering.Active() {
|
||||
// in filter mode we filter our reflog commits to just those containing the path
|
||||
|
Reference in New Issue
Block a user