* 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)
| 1726 | * common case — one cheap git call on the hot path. |
| 1727 | */ |
| 1728 | function 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? |
no test coverage detected