update vendor

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 07:10:14 +00:00
parent a18f72b565
commit ea8f47c73a
2901 changed files with 269317 additions and 43103 deletions

View File

@@ -0,0 +1,31 @@
package gitignore
import "strings"
// Only benchmark use
type fullScanPatterns struct {
absolute patterns
relative patterns
}
func newFullScanPatterns() *fullScanPatterns {
return &fullScanPatterns{
absolute: patterns{},
relative: patterns{},
}
}
func (ps *fullScanPatterns) add(pattern string) {
if strings.HasPrefix(pattern, "/") {
ps.absolute.add(newPattern(pattern))
} else {
ps.relative.add(newPattern(pattern))
}
}
func (ps fullScanPatterns) match(path string, isDir bool) bool {
if ps.absolute.match(path, isDir) {
return true
}
return ps.relative.match(path, isDir)
}