aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/excluder.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-06-28 16:22:29 +0200
committerJakob Unterwurzacher2025-07-09 19:28:09 +0200
commitb499c26526ff3a257310ed9fc2c04680d3ee4ab6 (patch)
treeb2a8408eaf40f6ed94e18a36d29a03d43d8b9715 /internal/fusefrontend_reverse/excluder.go
parent8372f8b94769827c2055195f59f7ea277e3aef9f (diff)
fusefrontend_reverse: switch from sabhiram/go-gitignore to internal/go-git-gitignore
Diffstat (limited to 'internal/fusefrontend_reverse/excluder.go')
-rw-r--r--internal/fusefrontend_reverse/excluder.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/internal/fusefrontend_reverse/excluder.go b/internal/fusefrontend_reverse/excluder.go
index 1cb4b80..4ee9daf 100644
--- a/internal/fusefrontend_reverse/excluder.go
+++ b/internal/fusefrontend_reverse/excluder.go
@@ -9,17 +9,23 @@ import (
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
- "github.com/sabhiram/go-gitignore"
+ gitignore "github.com/rfjakob/gocryptfs/v2/internal/go-git-gitignore"
)
// prepareExcluder creates an object to check if paths are excluded
// based on the patterns specified in the command line.
-func prepareExcluder(args fusefrontend.Args) *ignore.GitIgnore {
- patterns := getExclusionPatterns(args)
- if len(patterns) == 0 {
- log.Panic(patterns)
+func prepareExcluder(args fusefrontend.Args) gitignore.Matcher {
+ lines := getExclusionPatterns(args)
+ if len(lines) == 0 {
+ log.Panic(lines)
}
- return ignore.CompileIgnoreLines(patterns...)
+
+ var patterns []gitignore.Pattern
+ for _, l := range lines {
+ patterns = append(patterns, gitignore.ParsePattern(l, nil))
+ }
+
+ return gitignore.NewMatcher(patterns)
}
// getExclusionPatters prepares a list of patterns to be excluded.