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

Function createLocalSubmoduleRepo

tests/ipc/helpers.ts:644–657  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

642}
643
644async function createLocalSubmoduleRepo(): Promise<string> {
645 const submoduleRepoPath = await fs.mkdtemp(path.join(os.tmpdir(), "mux-test-submodule-"));
646 await execAsync("git init -b main", { cwd: submoduleRepoPath });
647 await execAsync(
648 `git config user.email "test@example.com" && git config user.name "Test User" && git config commit.gpgsign false`,
649 { cwd: submoduleRepoPath }
650 );
651 await fs.writeFile(path.join(submoduleRepoPath, "README.md"), "# Test submodule\n");
652 await execAsync("git add README.md", { cwd: submoduleRepoPath });
653 await execAsync('git -c commit.gpgsign=false commit -m "Initial submodule commit"', {
654 cwd: submoduleRepoPath,
655 });
656 return submoduleRepoPath;
657}
658
659/**
660 * Cleanup temporary git repository with retry logic

Callers 1

addSubmoduleFunction · 0.85

Calls 2

execAsyncFunction · 0.85
writeFileMethod · 0.65

Tested by

no test coverage detected