(rootDir: string)
| 828 | * on a giant ignored tree. |
| 829 | */ |
| 830 | export function findUnindexedIgnoredRepos(rootDir: string): string[] { |
| 831 | try { |
| 832 | execFileSync('git', ['rev-parse', '--git-dir'], { cwd: rootDir, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true }); |
| 833 | } catch { |
| 834 | return []; |
| 835 | } |
| 836 | const defaults = defaultsOnlyIgnore(); |
| 837 | const includeIgnored = loadIncludeIgnoredMatcher(rootDir); |
| 838 | const repos: string[] = []; |
| 839 | for (const dir of listIgnoredDirs(rootDir)) { |
| 840 | if (defaults.ignores(dir)) continue; // node_modules etc. — never project code |
| 841 | if (includeIgnored?.ignores(normalizePath(dir))) continue; // already opted in — nothing to nag about |
| 842 | for (const repo of findNestedGitRepos(path.join(rootDir, dir), dir)) { |
| 843 | // Per-repo opt-in check, mirroring findIgnoredEmbeddedRepos: a child |
| 844 | // pattern (`repos/a/`) doesn't match the parent dir above but DOES |
| 845 | // cover this repo — it's indexed, so don't nag about it (#1295). |
| 846 | if (includeIgnored?.ignores(normalizePath(repo))) continue; |
| 847 | repos.push(repo); |
| 848 | if (repos.length >= UNINDEXED_IGNORED_REPO_HINT_CAP) return repos; |
| 849 | } |
| 850 | } |
| 851 | return repos; |
| 852 | } |
| 853 | |
| 854 | /** |
| 855 | * Discover embedded repos hidden by `repoDir`'s OWN gitignore rules: for each |
no test coverage detected