MCPcopy Create free account
hub / github.com/tiann/hapi / resolveRepoRoot

Function resolveRepoRoot

cli/src/runner/worktree.ts:43–50  ·  view source on GitHub ↗
(basePath: string)

Source from the content-addressed store, hash-verified

41}
42
43async function resolveRepoRoot(basePath: string): Promise<string> {
44 const result = await runGit(['rev-parse', '--show-toplevel'], basePath);
45 const root = result.stdout.trim();
46 if (!root) {
47 throw new Error('Unable to resolve Git repository root.');
48 }
49 return root;
50}
51
52function toSlug(value: string): string {
53 const cleaned = value

Callers 1

createWorktreeFunction · 0.85

Calls 1

runGitFunction · 0.70

Tested by

no test coverage detected