mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +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:
parent
26ca41a40e
commit
015a04fac6
1 changed files with 5 additions and 13 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue