1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00

Remove redundant waitgroup

Turns out we're just running our refresh functions one after the other which isn't ideal but we can fix that separately.
As it stands this wait group isn't doing anything.
This commit is contained in:
Jesse Duffield 2023-07-08 15:22:26 +10:00
parent 26ca41a40e
commit 015a04fac6

View File

@ -63,8 +63,6 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
)
}
wg := sync.WaitGroup{}
f := func() {
var scopeSet *set.Set[types.RefreshableView]
if len(options.Scope) == 0 {
@ -87,15 +85,11 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
}
refresh := func(f func()) {
wg.Add(1)
func() {
if options.Mode == types.ASYNC {
self.c.OnWorker(f)
} else {
f()
}
wg.Done()
}()
if options.Mode == types.ASYNC {
self.c.OnWorker(f)
} else {
f()
}
}
if scopeSet.Includes(types.COMMITS) || scopeSet.Includes(types.BRANCHES) || scopeSet.Includes(types.REFLOG) || scopeSet.Includes(types.BISECT_INFO) {
@ -143,8 +137,6 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
refresh(func() { _ = self.mergeConflictsHelper.RefreshMergeState() })
}
wg.Wait()
self.refreshStatus()
if options.Then != nil {