MCPcopy Create free account
hub / github.com/go-git/go-git / simpleNameMatch

Method simpleNameMatch

plumbing/format/gitignore/pattern.go:92–105  ·  view source on GitHub ↗
(path []string, isDir bool)

Source from the content-addressed store, hash-verified

90}
91
92func (p *pattern) simpleNameMatch(path []string, isDir bool) bool {
93 for i, name := range path {
94 if match, err := filepath.Match(p.pattern[0], name); err != nil {
95 return false
96 } else if !match {
97 continue
98 }
99 if p.dirOnly && !isDir && i == len(path)-1 {
100 return false
101 }
102 return true
103 }
104 return false
105}
106
107func (p *pattern) globMatch(path []string, isDir bool) bool {
108 matched := false

Callers 1

MatchMethod · 0.95

Calls 1

MatchMethod · 0.65

Tested by

no test coverage detected