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

Function removeWorktree

cli/src/runner/worktree.ts:165–176  ·  view source on GitHub ↗
(options: {
  repoRoot: string;
  worktreePath: string;
})

Source from the content-addressed store, hash-verified

163}
164
165export async function removeWorktree(options: {
166 repoRoot: string;
167 worktreePath: string;
168}): Promise<RemoveWorktreeResult> {
169 try {
170 await runGit(['worktree', 'remove', '--force', options.worktreePath], options.repoRoot);
171 return { ok: true };
172 } catch (error) {
173 const message = error instanceof Error ? error.message : String(error);
174 return { ok: false, error: message };
175 }
176}

Callers 1

cleanupWorktreeFunction · 0.90

Calls 1

runGitFunction · 0.70

Tested by

no test coverage detected