mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-29 02:34:16 -05:00
PromptToContinueRebase and WithEnsureCommittableFiles both read Model.Files right after a SYNC FILES refresh. This works today because the model write currently happens synchronously in the worker before Refresh's wg.Wait() returns, but an upcoming commit will bounce that write onto the UI thread instead, at which point wg.Wait() no longer guarantees it's been applied. Move both reads into Then ahead of that change. Then is already queued via OnUIThread (previous commit), so this is a behavior-preserving refactor on its own: the model is fully written by the time Then runs either way, whether that write is still synchronous or gets bounced later. As part of restructuring WithEnsureCommittableFiles, prepareFilesForCommit and syncRefresh are inlined into their single call sites. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>