MCPcopy Create free account
hub / github.com/go-task/task / ignored

Function ignored

internal/fingerprint/gitignore.go:154–161  ·  view source on GitHub ↗

ignored honors Git's rule that a file under an ignored directory cannot be re-included by a deeper negation: if any ancestor directory is ignored, so is the file. Otherwise the file's own verdict applies (isDir=false).

(matcher gitignore.Matcher, segments []string)

Source from the content-addressed store, hash-verified

152// re-included by a deeper negation: if any ancestor directory is ignored, so is
153// the file. Otherwise the file's own verdict applies (isDir=false).
154func ignored(matcher gitignore.Matcher, segments []string) bool {
155 for i := 1; i < len(segments); i++ {
156 if matcher.Match(segments[:i], true) {
157 return true
158 }
159 }
160 return matcher.Match(segments, false)
161}
162
163func withinRepo(repoRoot, p string) bool {
164 rel, err := filepath.Rel(repoRoot, p)

Callers 1

filterGitignoredFunction · 0.85

Calls 1

MatchMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…