MCPcopy Create free account
hub / github.com/EvoMap/evolver / runGit

Function runGit

src/adapters/scripts/evolver-session-end.js:27–45  ·  view source on GitHub ↗
(args, cwd)

Source from the content-addressed store, hash-verified

25// (Bugbot PR #109 round-1 MEDIUM; reader/writer drift flagged on PR #555).
26
27function runGit(args, cwd) {
28 // Argv-array form, no shell. Avoids POSIX `2>/dev/null` redirects that
29 // break on Windows cmd.exe (#537). Failures (e.g. no HEAD~1 in a fresh
30 // repo) are surfaced as a non-zero status; callers distinguish them
31 // from successful empty output via the `ok` flag (PR #94 round-6 LOW).
32 const res = spawnSync('git', args, {
33 cwd,
34 encoding: 'utf8',
35 timeout: 5000,
36 maxBuffer: MAX_EXEC_BUFFER,
37 stdio: ['ignore', 'pipe', 'pipe'],
38 shell: false,
39 windowsHide: true,
40 });
41 if (res.status === 0 && typeof res.stdout === 'string') {
42 return { ok: true, out: res.stdout.trim() };
43 }
44 return { ok: false, out: '' };
45}
46
47function getGitDiffStats() {
48 // Use the host-provided workspace root, not process.cwd(): Cursor runs some

Callers 1

getGitDiffStatsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected