Fix apply --force against a dirty tree; clarify patch-count guard

Two issues found by exercising the scripts end to end:

- `git checkout -B` refuses to run when the worktree is dirty, so
  `make apply FORCE=1` aborted in exactly the situation FORCE exists
  to handle. Use `checkout -f -B`; the non-forced path has already
  verified the tree is clean, so forcing changes nothing there.

- The commit-count guard claimed the user forgot `make rebuild`, but
  deleting a patch file on purpose trips it identically. Say both,
  and document the FORCE=1 form in the README's "drop the example
  patches" instructions, which would otherwise have failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iceBear67
2026-08-14 04:52:37 +00:00
co-authored by Claude Opus 5
parent 618c8e31ee
commit 27f078331d
2 changed files with 10 additions and 5 deletions
+3 -2
View File
@@ -175,11 +175,12 @@ git format-patch --no-stat -N --zero-commit --full-index --no-signature
(或 `)`)结尾——**改上游代码时顺手确认它的测试仍然成立**,这个补丁本身就是个例子。
2. **`0002`** 新增文件——根目录 `FORK.md`
不需要就直接删
不需要就直接删。注意要带 `FORCE=1`——`work/` 里还留着这两个补丁的提交,而删掉补丁文件后
`patches/``work/` 少,安全检查会拦下来(它无法区分「你故意删的」和「你忘了 rebuild」):
```sh
rm patches/0001-*.patch patches/0002-*.patch
make apply
make apply FORCE=1
```
## 许可