From 53079998749fce2e5146fd7311a62bb1fb9e5739 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 11 Jul 2025 15:07:35 +0200 Subject: [PATCH] Allow passing SUB_COMMITS scope to Refresh when no subcommits view is showing We don't currently do this, but will in the next commit; it's a reasonable thing to want to do, and it shouldn't crash. --- pkg/gui/controllers/helpers/refresh_helper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index 2682d8296..dc396be3f 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -345,6 +345,10 @@ func (self *RefreshHelper) refreshCommitsWithLimit() error { } func (self *RefreshHelper) refreshSubCommitsWithLimit() error { + if self.c.Contexts().SubCommits.GetRef() == nil { + return nil + } + self.c.Mutexes().SubCommitsMutex.Lock() defer self.c.Mutexes().SubCommitsMutex.Unlock()