lib: Introduce fs.IsParent (fixes #5324) (#5326)

This commit is contained in:
Simon Frei authored and Jakob Borg committed 2018-11-22 11:16:45 +01:00
1 parent 513d3bc374
commit 2f9840ddae
6 files changed
+19 -11

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ func (w *walker) walkAndHashFiles(ctx context.Context, toHashChan chan<- protoco
return skip
}
// If the parent wasn't ignored already, set this path as the "highest" ignored parent
if info.IsDir() && (ignoredParent == "" || !strings.HasPrefix(path, ignoredParent+string(fs.PathSeparator))) {
if info.IsDir() && (ignoredParent == "" || !fs.IsParent(path, ignoredParent)) {
ignoredParent = path
}
return nil