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

Function gitCommittedChangesSince

src/extraction/index.ts:1728–1736  ·  view source on GitHub ↗

* NUL-delimited status/path pairs for every path committed * between `sinceCommit` and HEAD. Empty when the stamp IS HEAD, which is the * common case — one cheap git call on the hot path.

(repoDir: string, sinceCommit: string)

Source from the content-addressed store, hash-verified

1726 * common case — one cheap git call on the hot path.
1727 */
1728function gitCommittedChangesSince(repoDir: string, sinceCommit: string): string[] {
1729 // NUL framing preserves Unicode, quotes, tabs and newlines in Git paths.
1730 // Let command failures reach getGitChangedFiles: [] would falsely mean clean.
1731 const out = execFileSync('git', ['diff', '--relative', '--name-status', '--no-renames', '-z', sinceCommit, 'HEAD', '--', '.'], {
1732 cwd: repoDir, encoding: 'utf-8', timeout: 10000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true,
1733 env: readOnlyGitEnv(),
1734 });
1735 return out.split('\0');
1736}
1737
1738/**
1739 * Can an INDEX trust the git fast path, given the commit it was built at?

Callers 1

collectGitStatusFunction · 0.85

Calls 1

readOnlyGitEnvFunction · 0.85

Tested by

no test coverage detected