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

Method pruneWorktreesBestEffort

src/node/worktree/WorktreeManager.ts:49–59  ·  view source on GitHub ↗
(
    projectPath: string,
    noHooksEnv: GitExecOptions
  )

Source from the content-addressed store, hash-verified

47 }
48
49 private async pruneWorktreesBestEffort(
50 projectPath: string,
51 noHooksEnv: GitExecOptions
52 ): Promise<void> {
53 try {
54 using pruneProc = execFileAsync("git", ["-C", projectPath, "worktree", "prune"], noHooksEnv);
55 await pruneProc.result;
56 } catch {
57 // Ignore prune errors during cleanup/idempotent flows.
58 }
59 }
60
61 private async forceRemoveWorkspaceDirectory(workspacePath: string): Promise<void> {
62 // Use bash for rm -rf on Windows; shellQuote prevents injection from malicious paths.

Callers 3

deleteWorkspaceMethod · 0.95

Calls 1

execFileAsyncFunction · 0.90

Tested by

no test coverage detected