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 <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-07-02 21:45:02 +02:00
parent 5350b6c37b
commit b54d4c369b
3 changed files with 1 additions and 17 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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