aboutsummaryrefslogtreecommitdiff
path: root/lib/fs/basicfs_watch.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fs/basicfs_watch.go')
-rw-r--r--lib/fs/basicfs_watch.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/fs/basicfs_watch.go b/lib/fs/basicfs_watch.go
index cc8349652..ca3f306d3 100644
--- a/lib/fs/basicfs_watch.go
+++ b/lib/fs/basicfs_watch.go
@@ -37,18 +37,14 @@ func (f *BasicFilesystem) Watch(name string, ignore Matcher, ctx context.Context
eventMask |= permEventMask
}
- if ignore.SkipIgnoredDirs() {
- absShouldIgnore := func(absPath string) bool {
- rel, err := f.unrootedChecked(absPath, roots)
- if err != nil {
- return true
- }
- return ignore.Match(rel).IsIgnored()
+ absShouldIgnore := func(absPath string) bool {
+ rel, err := f.unrootedChecked(absPath, roots)
+ if err != nil {
+ return true
}
- err = notify.WatchWithFilter(watchPath, backendChan, absShouldIgnore, eventMask)
- } else {
- err = notify.Watch(watchPath, backendChan, eventMask)
+ return ignore.Match(rel).CanSkipDir()
}
+ err = notify.WatchWithFilter(watchPath, backendChan, absShouldIgnore, eventMask)
if err != nil {
notify.Stop(backendChan)
if reachedMaxUserWatches(err) {