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)
| 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). |
| 154 | func 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 | |
| 163 | func withinRepo(repoRoot, p string) bool { |
| 164 | rel, err := filepath.Rel(repoRoot, p) |
no test coverage detected
searching dependent graphs…