mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Bounce SUB_COMMITS model updates onto the UI thread
refreshSubCommitsWithLimit now loads the sub-commits on the worker and writes Model.SubCommits (and folds their authors into Model.Authors via RefreshAuthors) inside an onUIThreadUnlessRepoChanged bounce. SubCommitsMutex and AuthorsMutex are left in place: the former is shared with setSubCommits, the latter with the commits refresh's RefreshAuthors call, so both come out only once those other writers are on the UI thread too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
559b4bf298
commit
0f85c2b2b4
|
|
@ -594,6 +594,8 @@ func (self *RefreshHelper) refreshSubCommitsWithLimit() error {
|
|||
self.c.Mutexes().SubCommitsMutex.Lock()
|
||||
defer self.c.Mutexes().SubCommitsMutex.Unlock()
|
||||
|
||||
generation := self.c.State().GetRepoGeneration()
|
||||
|
||||
commits, err := self.c.Git().Loaders.CommitLoader.GetCommits(
|
||||
git_commands.GetCommitsOptions{
|
||||
Limit: self.c.Contexts().SubCommits.GetLimitCommits(),
|
||||
|
|
@ -610,8 +612,11 @@ func (self *RefreshHelper) refreshSubCommitsWithLimit() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
self.c.Model().SubCommits = commits
|
||||
self.RefreshAuthors(commits)
|
||||
self.onUIThreadUnlessRepoChanged(generation, func() error {
|
||||
self.c.Model().SubCommits = commits
|
||||
self.RefreshAuthors(commits)
|
||||
return nil
|
||||
})
|
||||
|
||||
self.refreshView(self.c.Contexts().SubCommits)
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue