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

Method removeGitWorktree

src/node/worktree/WorktreeManager.ts:867–881  ·  view source on GitHub ↗
(
    projectPath: string,
    workspacePath: string,
    force: boolean,
    noHooksEnv: GitExecOptions
  )

Source from the content-addressed store, hash-verified

865 }
866
867 private async removeGitWorktree(
868 projectPath: string,
869 workspacePath: string,
870 force: boolean,
871 noHooksEnv: GitExecOptions
872 ): Promise<void> {
873 const removeArgs = ["-C", projectPath, "worktree", "remove"];
874 if (force) {
875 removeArgs.push("--force");
876 }
877 removeArgs.push(workspacePath);
878
879 using proc = execFileAsync("git", removeArgs, noHooksEnv);
880 await proc.result;
881 }
882
883 private isMissingWorktreeError(message: string): boolean {
884 const normalizedError = message.toLowerCase();

Callers 1

deleteWorkspaceMethod · 0.95

Calls 2

execFileAsyncFunction · 0.90
pushMethod · 0.65

Tested by

no test coverage detected