From 6fd80565c73fe6b61e73c36b1868472b91642fdd Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 3 Oct 2023 09:36:46 +0200 Subject: [PATCH] Band-aid fix for submodule/reset.go test failure This is not a complete fix, but it's good enough to fix the spurious test failures of submodule/reset.go. We have some vague hope to fix this in a more sustainable way by somehow improving our concurrency model fundamentally, but that's a more long-term undertaking, and it's annoying that this test fails so often, so let's fix it in this way for now. --- pkg/gui/controllers/helpers/refresh_helper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index 578089af1..f04b102e4 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -449,9 +449,11 @@ func (self *RefreshHelper) refreshBranches() { // Need to re-render the commits view because the visualization of local // branch heads might have changed + self.c.Mutexes().LocalCommitsMutex.Lock() if err := self.c.Contexts().LocalCommits.HandleRender(); err != nil { self.c.Log.Error(err) } + self.c.Mutexes().LocalCommitsMutex.Unlock() self.refreshStatus() }