mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
This removes the last refresh mutex. RefreshingBranchesMutex wasn't guarding a data race (Branch.BehindBaseBranch is atomic, and every model write is now bounced onto the UI thread); it was serializing the two branch loads that race at the INITIAL startup stage — an immediate one sorted without the reflog, and an async one that loads the reflog and sorts by recency — so that the recency-sorted write landed last and won. That serialization was never a real guarantee, only "very likely": it relied on the immediate load acquiring the lock before the async load, which had to load the reflog first. Instead, each branch load takes a monotonically increasing sequence number, and its bounce drops the write if a later-started load has already applied. Combined with the preceding commit (immediate load runs before the async one is spawned), this is an actual guarantee: the immediate non-recency load always has a lower sequence than its recency async partner, so the highest sequence number is always held by a recency-sorted load, and highest-wins converges on recency ordering — even if more refreshes fire during the INITIAL window, since each refresh's async out-sequences its own immediate. The guard also subsumes what the mutex gave post-startup: a slow, stale refresh's bounce can no longer clobber a newer refresh's branches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| amend_helper.go | ||
| app_status_helper.go | ||
| bisect_helper.go | ||
| branches_helper.go | ||
| cherry_pick_helper.go | ||
| commits_helper.go | ||
| commits_helper_test.go | ||
| confirmation_helper.go | ||
| credentials_helper.go | ||
| diff_helper.go | ||
| files_helper.go | ||
| fixup_helper.go | ||
| fixup_helper_test.go | ||
| gpg_helper.go | ||
| helpers.go | ||
| host_helper.go | ||
| inline_status_helper.go | ||
| menu_key.go | ||
| merge_and_rebase_helper.go | ||
| merge_conflicts_helper.go | ||
| mode_helper.go | ||
| patch_building_helper.go | ||
| record_directory_helper.go | ||
| refresh_helper.go | ||
| refresh_helper_test.go | ||
| refs_helper.go | ||
| repos_helper.go | ||
| search_helper.go | ||
| signal_handling.go | ||
| signal_handling_windows.go | ||
| snake_helper.go | ||
| staging_helper.go | ||
| sub_commits_helper.go | ||
| suggestions_helper.go | ||
| suspend_resume_helper.go | ||
| tags_helper.go | ||
| update_helper.go | ||
| upstream_helper.go | ||
| upstream_helper_test.go | ||
| view_helper.go | ||
| window_arrangement_helper.go | ||
| window_arrangement_helper_test.go | ||
| window_helper.go | ||
| working_tree_helper.go | ||
| worktree_helper.go | ||
| worktree_helper_test.go | ||