MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getGitChangedFiles

Function getGitChangedFiles

src/extraction/index.ts:1092–1103  ·  view source on GitHub ↗

* Use `git status` to detect changed files instead of scanning every file. * Returns null on failure so callers fall back to full scan. * * Recurses into embedded repos — the untracked kind (#193: the parent's status * collapses them to an opaque `?? subdir/` entry) always, and the gitignored *

(rootDir: string)

Source from the content-addressed store, hash-verified

1090 * with it); a full `codegraph index` reconciles that.
1091 */
1092function getGitChangedFiles(rootDir: string): GitChanges | null {
1093 try {
1094 const changes: GitChanges = { modified: [], added: [], deleted: [] };
1095 // Custom extension → language overrides from the project's codegraph.json,
1096 // so change detection sees the same custom-extension files the full index does.
1097 const overrides = loadExtensionOverrides(rootDir);
1098 collectGitStatus(rootDir, '', changes, overrides, loadIncludeIgnoredMatcher(rootDir), loadExcludeMatcher(rootDir));
1099 return changes;
1100 } catch {
1101 return null;
1102 }
1103}
1104
1105function collectGitStatus(repoDir: string, prefix: string, out: GitChanges, overrides?: Record<string, Language>, includeIgnored: Ignore | null = null, exclude: Ignore | null = null): void {
1106 const output = execFileSync(

Callers 1

getChangedFilesMethod · 0.85

Calls 4

loadExtensionOverridesFunction · 0.90
collectGitStatusFunction · 0.85
loadExcludeMatcherFunction · 0.85

Tested by

no test coverage detected