lib/ignore: Consistent behaviour for nil *Matcher

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4310
This commit is contained in:
Simon Frei
2017-09-06 06:39:18 +00:00
committed by Jakob Borg
parent baec3f909c
commit 9dbc509996
2 changed files with 4 additions and 5 deletions

View File

@@ -85,6 +85,9 @@ func Walk(ctx context.Context, cfg Config) (chan protocol.FileInfo, error) {
if w.Filesystem == nil {
panic("no filesystem specified")
}
if w.Matcher == nil {
w.Matcher = ignore.New(w.Filesystem)
}
return w.walk(ctx)
}