summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/root_node.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-08-15 16:08:16 +0200
committerJakob Unterwurzacher2020-08-15 16:08:16 +0200
commit15b0b4a5fd268b421ddc347e4417b2538a540922 (patch)
tree5969cdd448bb3c105f15fe90b6f768d4be52bd1c /internal/fusefrontend_reverse/root_node.go
parentf270135c1614843f43a9df0e68b6e3fa556b6774 (diff)
v2api/reverse: start wiring up -exclude functionality
Exclude in readdir is missing.
Diffstat (limited to 'internal/fusefrontend_reverse/root_node.go')
-rw-r--r--internal/fusefrontend_reverse/root_node.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/root_node.go b/internal/fusefrontend_reverse/root_node.go
index 4297ecf..4346306 100644
--- a/internal/fusefrontend_reverse/root_node.go
+++ b/internal/fusefrontend_reverse/root_node.go
@@ -27,8 +27,8 @@ type RootNode struct {
nameTransform nametransform.NameTransformer
// Content encryption helper
contentEnc *contentenc.ContentEnc
- // Tests whether a path is excluded (hiden) from the user. Used by -exclude.
- excluder ignore.IgnoreParser
+ // Tests whether a path is excluded (hidden) from the user. Used by -exclude.
+ excluder *ignore.GitIgnore
// inoMap translates inode numbers from different devices to unique inode
// numbers.
inoMap *inomap.InoMap
@@ -78,3 +78,9 @@ func (rn *RootNode) findLongnameParent(fd int, diriv []byte, longname string) (p
}
return
}
+
+// isExcludedPlain finds out if the plaintext path "pPath" is
+// excluded (used when -exclude is passed by the user).
+func (rn *RootNode) isExcludedPlain(pPath string) bool {
+ return rn.excluder != nil && rn.excluder.MatchesPath(pPath)
+}