MCPcopy Index your code
hub / github.com/AI45Lab/Code / initGitRepo

Method initGitRepo

sdk/node/examples/git/test_worktree_git.ts:34–41  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

32 }
33
34 static initGitRepo(dir: string): void {
35 execSync("git init", { cwd: dir, stdio: "pipe" });
36 execSync('git config user.email "test@example.com"', { cwd: dir, stdio: "pipe" });
37 execSync('git config user.name "Test User"', { cwd: dir, stdio: "pipe" });
38 fs.writeFileSync(path.join(dir, "README.md"), "# Test Repo\n");
39 execSync("git add .", { cwd: dir, stdio: "pipe" });
40 execSync('git commit -m "Initial commit"', { cwd: dir, stdio: "pipe" });
41 }
42
43 static assert(condition: boolean, message: string): void {
44 if (!condition) throw new Error(`Assertion failed: ${message}`);

Callers 1

runAllMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected