1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00
This commit is contained in:
Jesse Duffield
2021-04-03 19:35:45 +11:00
parent e6274c0757
commit 633b6f596d
4 changed files with 25 additions and 9 deletions

View File

@ -79,6 +79,14 @@ func (gui *Gui) dispatchSwitchToRepo(path string) error {
gui.GitCommand = 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()
gui.Mutexes.RefreshingFilesMutex.Lock()
defer gui.Mutexes.RefreshingFilesMutex.Unlock()
gui.resetState("")
return nil