Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove file watcher code #2865

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/creack/pty v1.1.11
github.com/fsmiamoto/git-todo-parser v0.0.5
github.com/fsnotify/fsnotify v1.4.7
github.com/gdamore/tcell/v2 v2.6.0
github.com/go-errors/errors v1.4.2
github.com/gookit/color v1.4.2
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsmiamoto/git-todo-parser v0.0.5 h1:Bhzd/vz/6Qm3udfkd6NO9fWfD3TpwR9ucp3N75/J5I8=
github.com/fsmiamoto/git-todo-parser v0.0.5/go.mod h1:B+AgTbNE2BARvJqzXygThzqxLIaEWvwr2sxKYYb0Fas=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
Expand Down
1 change: 0 additions & 1 deletion pkg/gui/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func (gui *Gui) resetHelpersAndControllers() {
stagingHelper,
mergeConflictsHelper,
worktreeHelper,
gui.fileWatcher,
)
diffHelper := helpers.NewDiffHelper(helperCommon)
cherryPickHelper := helpers.NewCherryPickHelper(
Expand Down
7 changes: 0 additions & 7 deletions pkg/gui/controllers/helpers/refresh_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type RefreshHelper struct {
stagingHelper *StagingHelper
mergeConflictsHelper *MergeConflictsHelper
worktreeHelper *WorktreeHelper
fileWatcher types.IFileWatcher
}

func NewRefreshHelper(
Expand All @@ -39,7 +38,6 @@ func NewRefreshHelper(
stagingHelper *StagingHelper,
mergeConflictsHelper *MergeConflictsHelper,
worktreeHelper *WorktreeHelper,
fileWatcher types.IFileWatcher,
) *RefreshHelper {
return &RefreshHelper{
c: c,
Expand All @@ -49,7 +47,6 @@ func NewRefreshHelper(
stagingHelper: stagingHelper,
mergeConflictsHelper: mergeConflictsHelper,
worktreeHelper: worktreeHelper,
fileWatcher: fileWatcher,
}
}

Expand Down Expand Up @@ -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
}

Expand Down
137 changes: 0 additions & 137 deletions pkg/gui/file_watching.go

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ type Gui struct {
Updater *updates.Updater
statusManager *status.StatusManager
waitForIntro sync.WaitGroup
fileWatcher *fileWatcher
viewBufferManagerMap map[string]*tasks.ViewBufferManager
// holds a mapping of view names to ptmx's. This is for rendering command outputs
// from within a pty. The point of keeping track of them is so that if we re-size
Expand Down Expand Up @@ -476,8 +475,6 @@ func NewGui(
afterLayoutFuncs: make(chan func() error, 1000),
}

gui.WatchFilesForChanges()

gui.PopupHandler = popup.NewPopupHandler(
cmn,
func(ctx goContext.Context, opts types.CreatePopupPanelOpts) error {
Expand Down Expand Up @@ -680,10 +677,6 @@ func (gui *Gui) RunAndHandleError(startArgs appTypes.StartArgs) error {
manager.Close()
}

if !gui.fileWatcher.Disabled {
gui.fileWatcher.Watcher.Close()
}

close(gui.stopChan)

switch err {
Expand Down
4 changes: 0 additions & 4 deletions pkg/gui/types/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ const (
COMPLETE
)

type IFileWatcher interface {
AddFilesToFileWatcher(files []*models.File) error
}

// screen sizing determines how much space your selected window takes up (window
// as in panel, not your terminal's window). Sometimes you want a bit more space
// to see the contents of a panel, and this keeps track of how much maximisation
Expand Down
6 changes: 0 additions & 6 deletions vendor/github.com/fsnotify/fsnotify/.gitignore

This file was deleted.

52 changes: 0 additions & 52 deletions vendor/github.com/fsnotify/fsnotify/AUTHORS

This file was deleted.

Loading
Loading