Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/opencode/src/worktree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,13 @@ export namespace Worktree {
if (key === directory) return item
}
})()

if (!entry?.path) {
throw new RemoveFailedError({ message: "Worktree not found" })
const directoryExists = await exists(directory)
if (directoryExists) {
await fs.rm(directory, { recursive: true, force: true })
}
return true
}

const removed = await $`git worktree remove --force ${entry.path}`.quiet().nothrow().cwd(Instance.worktree)
Expand Down
Loading