修复任务提交脚本混入已暂存改动的问题

This commit is contained in:
2026-04-20 09:11:03 +00:00
parent d43d9f81d0
commit 0efe887fa3
3 changed files with 54 additions and 3 deletions

View File

@@ -47,6 +47,7 @@ node scripts/commit-task.mjs \
3. 指定文件没有改动时不会创建空提交。
4. 脚本不会自动把未指定文件加入提交。
5. 脚本不做 `amend`,不改写历史。
6. 即使索引里已经有其他已暂存文件,脚本也只会提交本次显式传入的文件。
## 5. 适用范围
@@ -76,3 +77,4 @@ node scripts/commit-task.mjs \
1. `scripts/commit-task.test.ts`
2. 覆盖“只提交指定文件,保留未指定改动在工作区”的核心行为
3. 覆盖“已有其他 staged 改动时不混入当前提交”的边界行为