diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 10:27:34 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:59:45 +1100 |
commit | f7add8d788604743b334c72b784c487968b99867 (patch) | |
tree | 64c850b77954d15e5a2451ce4b6aa089cf578b11 /pkg/gui/view_helpers.go | |
parent | d97c2307476253be353edc1ad85c2658c0f78ebe (diff) |
smarter refreshing for tags and remotes
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 60d548bcb..50c40ede3 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -61,7 +61,7 @@ func (gui *Gui) refreshSidePanels(options refreshOptions) error { scopeMap = intArrToMap(options.scope) } - if scopeMap[COMMITS] || scopeMap[BRANCHES] || scopeMap[REFLOG] || scopeMap[TAGS] || scopeMap[REMOTES] { + if scopeMap[COMMITS] || scopeMap[BRANCHES] || scopeMap[REFLOG] { wg.Add(1) func() { if options.mode == ASYNC { @@ -97,8 +97,34 @@ func (gui *Gui) refreshSidePanels(options refreshOptions) error { }() } + if scopeMap[TAGS] { + wg.Add(1) + func() { + if options.mode == ASYNC { + go gui.refreshTags() + } else { + gui.refreshTags() + } + wg.Done() + }() + } + + if scopeMap[REMOTES] { + wg.Add(1) + func() { + if options.mode == ASYNC { + go gui.refreshRemotes() + } else { + gui.refreshRemotes() + } + wg.Done() + }() + } + wg.Wait() + gui.refreshStatus() + if options.then != nil { options.then() } |