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

Function gitCommittedChangesSince

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

1691 * common case — one cheap git call on the hot path.
1692 */
1693function gitCommittedChangesSince(repoDir: string, sinceCommit: string): string[] {
1694 // NUL framing preserves Unicode, quotes, tabs and newlines in Git paths.
1695 // Let command failures reach getGitChangedFiles: [] would falsely mean clean.
1696 const out = execFileSync('git', ['diff', '--relative', '--name-status', '--no-renames', '-z', sinceCommit, 'HEAD', '--', '.'], {
1697 cwd: repoDir, encoding: 'utf-8', timeout: 10000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true,
1698 });
1699 return out.split('\0');
1700}
1701
1702/**
1703 * Can an INDEX trust the git fast path, given the commit it was built at?

Callers 1

collectGitStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected