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

Function branchExists

cli/src/runner/worktree.ts:92–99  ·  view source on GitHub ↗
(repoRoot: string, branch: string)

Source from the content-addressed store, hash-verified

90}
91
92async function branchExists(repoRoot: string, branch: string): Promise<boolean> {
93 try {
94 await runGit(['show-ref', '--verify', `refs/heads/${branch}`], repoRoot);
95 return true;
96 } catch {
97 return false;
98 }
99}
100
101export async function createWorktree(options: {
102 basePath: string;

Callers 1

createWorktreeFunction · 0.85

Calls 1

runGitFunction · 0.70

Tested by

no test coverage detected