mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
DispatchSwitchTo wrapped its whole body in WithWaitingStatus, so the switch ran on a worker: it chdirs, reassigns gui.git, and swaps gui.State (in resetState), all of which the UI thread also reads. The generation guard prevents the refresh-in-flight logical corruption but not this pointer data race on gui.State. Run the switch synchronously on the UI thread instead. Every caller is already a UI-thread handler except NewWorktreeCheckout, which must create the worktree (git work) on a worker first; it now dispatches only the switch via OnUIThread. The heavy data loading still happens asynchronously via the refresh that onNewRepo triggers, so the synchronous part is small (a couple of git rev-parse plus direnv). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| cheatsheet | ||
| commands | ||
| common | ||
| config | ||
| constants | ||
| env | ||
| fakes | ||
| gocui | ||
| gui | ||
| i18n | ||
| integration | ||
| jsonschema | ||
| logs | ||
| snake | ||
| tasks | ||
| theme | ||
| updates | ||
| utils | ||