mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
BranchLoader.Load reads the reflog commits to sort branches by recency. Today it reads them straight from Model.ReflogCommits, which works because in the recency path the reflog refresh writes that field synchronously just before the branches refresh reads it (same goroutine, sequential). An upcoming commit bounces the reflog model write onto the UI thread, at which point Model.ReflogCommits wouldn't be updated yet when branches runs — branches would sort by the previous refresh's reflog. To decouple the branches load from *when* that write lands, pass the reflog commits to refreshBranches explicitly: refreshReflogCommits now returns the commits it loaded, and the recency path hands them straight to refreshBranches. The non-recency path (branches and reflog run concurrently, as before) keeps passing Model.ReflogCommits. Pure refactor: behavior is identical, since the value passed is exactly what Load read from the model before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| cheatsheet | ||
| commands | ||
| common | ||
| config | ||
| constants | ||
| env | ||
| fakes | ||
| gocui | ||
| gui | ||
| i18n | ||
| integration | ||
| jsonschema | ||
| logs | ||
| snake | ||
| tasks | ||
| theme | ||
| updates | ||
| utils | ||