fix(git): 文档关闭后再清理工作树

This commit is contained in:
zhiye.sun
2026-09-03 14:18:55 +08:00
parent 7026f249d0
commit 72a6f71dd0
5 changed files with 22 additions and 8 deletions
@@ -34,6 +34,8 @@ git worktree add -b "<branch>" "<absolute-worktree-path>" "<base>"
- 当前 HEAD 已被预期本地分支引用;
- 主仓库、worktree 路径、分支和 HEAD 均已准确确认。
还要读取 `.craftkit/project.json` 的 `documents.workRoot`,检查该 Worktree 中与本分支任务对应的 `task.json` 和 ignored 文件。任务状态未到 `closed`、存在未登记的忽略文件或关闭清单尚未处理时,先执行 `knowledge:document-output close` 预览;用户要求保留现场时不得移除 Worktree。
展示检查结果、移除后保留的分支和唯一清理命令,取得用户确认后执行:
```text