MCPcopy
hub / github.com/colbymchenry/codegraph / getGitChangedFiles

Function getGitChangedFiles

src/extraction/index.ts:833–844  ·  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

831 * with it); a full `codegraph index` reconciles that.
832 */
833function getGitChangedFiles(rootDir: string): GitChanges | null {
834 try {
835 const changes: GitChanges = { modified: [], added: [], deleted: [] };
836 // Custom extension → language overrides from the project's codegraph.json,
837 // so change detection sees the same custom-extension files the full index does.
838 const overrides = loadExtensionOverrides(rootDir);
839 collectGitStatus(rootDir, '', changes, overrides, loadIncludeIgnoredMatcher(rootDir), loadExcludeMatcher(rootDir));
840 return changes;
841 } catch {
842 return null;
843 }
844}
845
846function collectGitStatus(repoDir: string, prefix: string, out: GitChanges, overrides?: Record<string, Language>, includeIgnored: Ignore | null = null, exclude: Ignore | null = null): void {
847 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