summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-08 20:47:16 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-09 20:57:18 +1000
commite588355f578ad18d21aa14d20c4a76b48e2adfd0 (patch)
treeac594eb3d8b32cec68f8c1b283d11651597317f6 /pkg/gui/gui.go
parentc7a3b69eb92dd5b543769cafcb2992da1ee8ed4d (diff)
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
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 5f5955e5a..33057ba42 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -448,14 +448,15 @@ func NewGui(
// sake of backwards compatibility. We're making use of short circuiting here
ShowExtrasWindow: cmn.UserConfig.Gui.ShowCommandLog && !config.GetAppState().HideCommandLog,
Mutexes: types.Mutexes{
- RefreshingFilesMutex: &deadlock.Mutex{},
- RefreshingStatusMutex: &deadlock.Mutex{},
- SyncMutex: &deadlock.Mutex{},
- LocalCommitsMutex: &deadlock.Mutex{},
- SubCommitsMutex: &deadlock.Mutex{},
- SubprocessMutex: &deadlock.Mutex{},
- PopupMutex: &deadlock.Mutex{},
- PtyMutex: &deadlock.Mutex{},
+ RefreshingFilesMutex: &deadlock.Mutex{},
+ RefreshingBranchesMutex: &deadlock.Mutex{},
+ RefreshingStatusMutex: &deadlock.Mutex{},
+ SyncMutex: &deadlock.Mutex{},
+ LocalCommitsMutex: &deadlock.Mutex{},
+ SubCommitsMutex: &deadlock.Mutex{},
+ SubprocessMutex: &deadlock.Mutex{},
+ PopupMutex: &deadlock.Mutex{},
+ PtyMutex: &deadlock.Mutex{},
},
InitialDir: initialDir,
}