matchGitignorePattern checks if relPath matches a single .gitignore pattern. Polarity is not this function's concern: a negated pattern reports false, so callers testing one pattern in isolation still read it as "does this exclude the path". Ordered resolution across a whole pattern list, where neg
(relPath, pat string)
| 340 | // the path". Ordered resolution across a whole pattern list, where negations do |
| 341 | // carry meaning, lives in isPathExcluded. |
| 342 | func matchGitignorePattern(relPath, pat string) bool { |
| 343 | if strings.HasPrefix(pat, "!") { |
| 344 | return false |
| 345 | } |
| 346 | return matchGitignoreBody(relPath, pat) |
| 347 | } |
| 348 | |
| 349 | // matchGitignoreBody reports whether relPath matches a single pattern body — |
| 350 | // the pattern with any leading "!" already stripped. |
no test coverage detected