diff options
Diffstat (limited to 'internal/go-git-gitignore/pattern.go')
-rw-r--r-- | internal/go-git-gitignore/pattern.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/go-git-gitignore/pattern.go b/internal/go-git-gitignore/pattern.go index c80e841..94d585f 100644 --- a/internal/go-git-gitignore/pattern.go +++ b/internal/go-git-gitignore/pattern.go @@ -90,6 +90,13 @@ func (p *pattern) Match(path []string, isDir bool) MatchResult { } func (p *pattern) simpleNameMatch(path []string, isDir bool) bool { + // gocryptfs patch: simple fix for https://github.com/go-git/go-git/issues/1596 + // gocryptfs can get away with this because each parent directory has already been checked + // separately on LOOKUP. + if p.dirOnly && !isDir { + return false + } + for i, name := range path { if match, err := filepath.Match(p.pattern[0], name); err != nil { return false |