1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-23 22:24:51 +02:00

smarter refreshing for tags and remotes

This commit is contained in:
Jesse Duffield
2020-03-28 10:27:34 +11:00
parent d97c230747
commit f7add8d788
7 changed files with 75 additions and 39 deletions

View File

@@ -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()
}