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

Function ensureGitRepo

test/loopMode.test.js:272–279  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

270 // the spawned daemon and short-circuit the test. Init it as a git repo
271 // since the daemon refuses to run outside of one.
272 function ensureGitRepo(dir) {
273 try {
274 execFileSync('git', ['init', '-q'], { cwd: dir, stdio: 'ignore' });
275 execFileSync('git', ['config', 'user.email', 'test@example.com'], { cwd: dir, stdio: 'ignore' });
276 execFileSync('git', ['config', 'user.name', 'test'], { cwd: dir, stdio: 'ignore' });
277 execFileSync('git', ['commit', '--allow-empty', '-m', 'init', '-q'], { cwd: dir, stdio: 'ignore' });
278 } catch (_) { /* best-effort */ }
279 }
280
281 function daemonChildEnv(extraEnv = {}) {
282 return {

Callers 1

runDaemonOnceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected