fix(vcs): offer to delete the worktree holding a branch being deleted (#2119)

Deleting a branch checked out in another worktree failed with git's `used by worktree` error and offered no way forward. The delete flow now detects the holding worktree and offers to remove both the worktree and the branch in one confirmed step; a dirty worktree goes to Force Remove with git's own error shown.

A worktree that is the open project or contains it is never offered, and the main worktree keeps git's message. Worktrees below a project opened on a parent folder are still offered.

Sibling covered: multi-repository branch deletion passes the target repository explicitly instead of relying on the focused one, which a refresh after a worktree removal could change, so each branch is deleted in its own repository and focus stays where it was.

Co-authored-by: muutot <[email protected]>
Цей коміт міститься в:
Muuтаmuutot authored and GitHub committed 2026-11-08 21:24:58 +08:00
1 джерело fd717d2305
коміт dc8efedf75
5 files changed
+307 -40

No files matched your search

+2 -1
Переглянути файл
@@ -429,5 +429,6 @@
"Allowed for this session": "Allowed for this session",
"Always allowed": "Always allowed",
"Declined": "Declined",
"Always declined": "Always declined"
"Always declined": "Always declined",
"Branch '{name}' is checked out in the worktree at {path}.\nDelete the worktree and the branch? Its folder is deleted.": "Branch '{name}' is checked out in the worktree at {path}.\nDelete the worktree and the branch? Its folder is deleted."
}
+2 -1
Переглянути файл
@@ -6782,5 +6782,6 @@
"Allowed for this session": "已在此会话中允许",
"Always allowed": "已设为始终允许",
"Declined": "已拒绝",
"Always declined": "已设为始终拒绝"
"Always declined": "已设为始终拒绝",
"Branch '{name}' is checked out in the worktree at {path}.\nDelete the worktree and the branch? Its folder is deleted.": "分支 '{name}' 被位于 {path} 的工作树签出。\n删除该工作树和分支?其文件夹将被删除。"
}