MCPcopy
hub / github.com/coder/mux / createLocalGitRepository

Function createLocalGitRepository

src/node/services/projectService.test.ts:14–27  ·  view source on GitHub ↗
(rootDir: string, repoName: string)

Source from the content-addressed store, hash-verified

12import { ProjectService, type CloneEvent } from "./projectService";
13
14async function createLocalGitRepository(rootDir: string, repoName: string): Promise<string> {
15 const repoPath = path.join(rootDir, repoName);
16 await fs.mkdir(repoPath, { recursive: true });
17 await fs.writeFile(path.join(repoPath, "README.md"), "# test\n", "utf-8");
18
19 execSync("git init -b main", { cwd: repoPath, stdio: "ignore" });
20 execSync("git add README.md", { cwd: repoPath, stdio: "ignore" });
21 execSync('git -c user.name="test" -c user.email="test@test" commit -m "initial"', {
22 cwd: repoPath,
23 stdio: "ignore",
24 });
25
26 return repoPath;
27}
28
29const ARCHIVED_AT = "2026-01-01T00:00:00.000Z";
30

Callers 1

Calls 1

writeFileMethod · 0.65

Tested by

no test coverage detected