فهرست منبع

feat(finishing-a-development-branch): add Step 5 cleanup guard (PRI-823)

Re-detect externally managed worktree at cleanup time and skip removal.
Also fixes pre-existing inconsistency: cleanup now correctly says
Options 1 and 4 only, matching Quick Reference and Common Mistakes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drew Ritter 6 ماه پیش
والد
کامیت
c319e2be6d
1فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 10 1
      skills/finishing-a-development-branch/SKILL.md

+ 10 - 1
skills/finishing-a-development-branch/SKILL.md

@@ -179,7 +179,16 @@ Then: Cleanup worktree (Step 5)
 
 
 ### Step 5: Cleanup Worktree
 ### Step 5: Cleanup Worktree
 
 
-**For Options 1, 2, 4:**
+**First, check if worktree is externally managed:**
+
+````bash
+GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
+GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
+````
+
+If `GIT_DIR` differs from `GIT_COMMON`: skip worktree removal — the host environment owns this workspace.
+
+**Otherwise, for Options 1 and 4:**
 
 
 Check if in worktree:
 Check if in worktree:
 ```bash
 ```bash