summaryrefslogtreecommitdiffstats
path: root/pkg/gui/recent_repos_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-15 12:04:00 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-15 14:15:41 +1100
commitcdcfeb396fda1e61dee9b6d88ab4659152a10948 (patch)
tree6b796b8ffc9e30c08e5249e936feacca76f8d8ba /pkg/gui/recent_repos_panel.go
parentf5b9ad8c002eb359959d41f4cd494007ca3e9bf3 (diff)
stop refreshing the screen so much
Diffstat (limited to 'pkg/gui/recent_repos_panel.go')
-rw-r--r--pkg/gui/recent_repos_panel.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go
index c2f389a78..7bf6b068c 100644
--- a/pkg/gui/recent_repos_panel.go
+++ b/pkg/gui/recent_repos_panel.go
@@ -4,7 +4,6 @@ import (
"os"
"path/filepath"
- "github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
"github.com/jesseduffield/lazygit/pkg/env"
@@ -77,19 +76,15 @@ func (gui *Gui) dispatchSwitchToRepo(path string, reuse bool) error {
}
gui.Git = newGitCommand
- gui.g.Update(func(*gocui.Gui) error {
- // these two mutexes are used by our background goroutines (triggered via `gui.goEvery`. We don't want to
- // switch to a repo while one of these goroutines is in the process of updating something
- gui.Mutexes.FetchMutex.Lock()
- defer gui.Mutexes.FetchMutex.Unlock()
+ // these two mutexes are used by our background goroutines (triggered via `gui.goEvery`. We don't want to
+ // switch to a repo while one of these goroutines is in the process of updating something
+ gui.Mutexes.FetchMutex.Lock()
+ defer gui.Mutexes.FetchMutex.Unlock()
- gui.Mutexes.RefreshingFilesMutex.Lock()
- defer gui.Mutexes.RefreshingFilesMutex.Unlock()
+ gui.Mutexes.RefreshingFilesMutex.Lock()
+ defer gui.Mutexes.RefreshingFilesMutex.Unlock()
- gui.resetState("", reuse)
-
- return nil
- })
+ gui.resetState("", reuse)
return nil
}