From b54d4c369bb64415b79e89ad0c5c275a971fd8dc Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 2 Jul 2026 21:45:02 +0200 Subject: [PATCH] Remove unused IsRefreshingFiles state GetIsRefreshingFiles() is never called anywhere in the codebase, so the flag serves no purpose. Remove it from Gui, StateAccessor, and IStateAccessor, and drop the two SetIsRefreshingFiles calls in refreshFilesAndSubmodules that maintained it. Co-Authored-By: Claude Sonnet 5 --- pkg/gui/controllers/helpers/refresh_helper.go | 6 +----- pkg/gui/gui.go | 10 ---------- pkg/gui/types/common.go | 2 -- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index 3dbd19674..866ec90c3 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -735,11 +735,7 @@ func (self *RefreshHelper) refreshBranches(refreshWorktrees bool, keepBranchSele func (self *RefreshHelper) refreshFilesAndSubmodules(background bool) error { self.c.Mutexes().RefreshingFilesMutex.Lock() - self.c.State().SetIsRefreshingFiles(true) - defer func() { - self.c.State().SetIsRefreshingFiles(false) - self.c.Mutexes().RefreshingFilesMutex.Unlock() - }() + defer self.c.Mutexes().RefreshingFilesMutex.Unlock() if err := self.refreshStateSubmoduleConfigs(); err != nil { return err diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index e23afd124..87a87f7b2 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -111,8 +111,6 @@ type Gui struct { PopupHandler types.IPopupHandler - IsRefreshingFiles bool - // we use this to decide whether we'll return to the original directory that // lazygit was opened in, or if we'll retain the one we're currently in. RetainOriginalDir bool @@ -175,14 +173,6 @@ func (self *StateAccessor) GetPagerConfig() *config.PagerConfig { return self.gui.pagerConfig } -func (self *StateAccessor) GetIsRefreshingFiles() bool { - return self.gui.IsRefreshingFiles -} - -func (self *StateAccessor) SetIsRefreshingFiles(value bool) { - self.gui.IsRefreshingFiles = value -} - func (self *StateAccessor) GetShowExtrasWindow() bool { return self.gui.ShowExtrasWindow } diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go index 7621f8686..ad28972ae 100644 --- a/pkg/gui/types/common.go +++ b/pkg/gui/types/common.go @@ -377,8 +377,6 @@ type IStateAccessor interface { // tells us whether we're currently updating lazygit GetUpdating() bool SetUpdating(bool) - SetIsRefreshingFiles(bool) - GetIsRefreshingFiles() bool GetShowExtrasWindow() bool SetShowExtrasWindow(bool) GetRetainOriginalDir() bool