mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-30 12:19:54 +00:00
* Update Kubernetes to v1.21.0 * Update to golang v1.16.2 * Update dependent modules to track with upstream * Switch to upstream flannel * Track changes to upstream cloud-controller-manager and FeatureGates Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
32 lines
601 B
Go
32 lines
601 B
Go
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)
|
|
}
|