diff --git a/lib/scanner/walk.go b/lib/scanner/walk.go index 869c944d6..68357ece4 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) {