From 54269553c8f02edcffa47c903fb1a9576c4b57c1 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 4 Sep 2015 11:50:47 +0200 Subject: [PATCH] lib/scanner need not depend on lib/ignore --- lib/scanner/walk.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/scanner/walk.go b/lib/scanner/walk.go index 869c944d..68357ece 100644 --- a/lib/scanner/walk.go +++ b/lib/scanner/walk.go @@ -19,7 +19,6 @@ import ( "github.com/syncthing/protocol" "github.com/syncthing/syncthing/lib/db" "github.com/syncthing/syncthing/lib/events" - "github.com/syncthing/syncthing/lib/ignore" "github.com/syncthing/syncthing/lib/osutil" "github.com/syncthing/syncthing/lib/symlinks" "golang.org/x/text/unicode/norm" @@ -50,7 +49,7 @@ type Walker struct { // BlockSize controls the size of the block used when hashing. BlockSize int // If Matcher is not nil, it is used to identify files to ignore which were specified by the user. - Matcher *ignore.Matcher + Matcher IgnoreMatcher // If TempNamer is not nil, it is used to ignore temporary files when walking. TempNamer TempNamer // Number of hours to keep temporary files for @@ -87,6 +86,11 @@ type CurrentFiler interface { CurrentFile(name string) (protocol.FileInfo, bool) } +type IgnoreMatcher interface { + // Match returns true if the file should be ignored. + Match(filename string) bool +} + // Walk returns the list of files found in the local folder by scanning the // file system. Files are blockwise hashed. func (w *Walker) Walk() (chan protocol.FileInfo, error) {