Remove file watcher code

Now that we refresh upon focus, we can scrap this file watching code.
Stefan says few git UIs use file watching, and I understand why: the
reason this code was problematic in the first place is that watching
files is expensive and if you have too many open file handles that
can cause problems.

Importantly: this code that's being removed was _already_ dead.
This commit is contained in:
Jesse Duffield 2023-08-02 20:53:24 +10:00
parent c8520fbe78
commit 92f0aa23cc
22 changed files with 0 additions and 2452 deletions

View file

@ -28,7 +28,6 @@ type RefreshHelper struct {
stagingHelper *StagingHelper
mergeConflictsHelper *MergeConflictsHelper
worktreeHelper *WorktreeHelper
fileWatcher types.IFileWatcher
}
func NewRefreshHelper(
@ -39,7 +38,6 @@ func NewRefreshHelper(
stagingHelper *StagingHelper,
mergeConflictsHelper *MergeConflictsHelper,
worktreeHelper *WorktreeHelper,
fileWatcher types.IFileWatcher,
) *RefreshHelper {
return &RefreshHelper{
c: c,
@ -49,7 +47,6 @@ func NewRefreshHelper(
stagingHelper: stagingHelper,
mergeConflictsHelper: mergeConflictsHelper,
worktreeHelper: worktreeHelper,
fileWatcher: fileWatcher,
}
}
@ -548,10 +545,6 @@ func (self *RefreshHelper) refreshStateFiles() error {
fileTreeViewModel.SetTree()
fileTreeViewModel.RWMutex.Unlock()
if err := self.fileWatcher.AddFilesToFileWatcher(files); err != nil {
return err
}
return nil
}