mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
refreshBranches now loads the branches (and worktrees) on the worker and writes Model.Branches, the pull-requests map, Model.Worktrees, and the restored branch selection in an onUIThreadUnlessRepoChanged bounce. The selection restore and rebuildPullRequestsMap run in the bounce so they see the branches we just wrote; the LocalCommits re-render (for branch head visualization) moves into the same bounce. refreshStatus is adjusted to read the checked-out branch and the linked worktree name inside its bounce rather than on the worker: both derive from models (Branches, Worktrees) that are now written via bounces, so reading them on the worker would format the status from stale values — which showed up as the status line dropping the "(worktree)" suffix right after entering a submodule or switching worktrees. The git work (WorkingTreeState) stays on the worker. Two callers that read the branches model right after a SYNC branches refresh move their reads into Then: - BranchesHelper.PostFetchRefresh: AutoForwardBranches reads Model.Branches, so it runs in Then (preserving that a fetch error is still returned to the caller and that background auto-forward errors aren't surfaced as a popup). - BranchesController rename: the re-select-by-name loop runs in Then. RefreshingBranchesMutex is left in place for the mutex cleanup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| context | ||
| controllers | ||
| filetree | ||
| mergeconflicts | ||
| modes | ||
| patch_exploring | ||
| popup | ||
| presentation | ||
| services/custom_commands | ||
| status | ||
| style | ||
| types | ||
| background.go | ||
| command_log_panel.go | ||
| context.go | ||
| context_config.go | ||
| controllers.go | ||
| dummies.go | ||
| editors.go | ||
| extras_panel.go | ||
| global_handlers.go | ||
| gui.go | ||
| gui_common.go | ||
| gui_driver.go | ||
| information_panel.go | ||
| keybindings.go | ||
| layout.go | ||
| main_panels.go | ||
| menu_panel.go | ||
| options_map.go | ||
| pty.go | ||
| recent_repos_panel.go | ||
| side_panels.go | ||
| side_panels_test.go | ||
| tasks_adapter.go | ||
| test_mode.go | ||
| view_helpers.go | ||
| views.go | ||