Guard orphaned worktree deletion behind project context

- Require both orphaned worktree path and thread project before prompting delete
- Prevents delete confirmation when project metadata is unavailable
This commit is contained in:
Julius Marminge authored and Julius Marminge committed 2026-02-12 22:57:56 -08:00
1 parent 4f5eb3be4d
commit 293f7b1507
1 file changed
+2 -1
+2 -1
View File
@@ -268,8 +268,9 @@ export default function Sidebar() {
const displayWorktreePath = orphanedWorktreePath
? formatWorktreePathForDisplay(orphanedWorktreePath)
: null;
const canDeleteWorktree = orphanedWorktreePath !== null && threadProject !== undefined;
const shouldDeleteWorktree =
orphanedWorktreePath !== null &&
canDeleteWorktree &&
(await api.dialogs.confirm(
[
"This thread is the only one linked to this worktree:",