Repository navigation
v4.6.1 — 两种语言,一条线
4.6.1
修一个只在 CI 上暴露的回归:中英同步把 CRLF 检出误判成「没同步」。
- 4.6.0 引入的
tools/sync-bilingual.mjs假设\n行尾。Windows runner 的core.autocrlf=true会把仓库检出成 CRLF,
于是自测报README.md out of sync,三个矩阵任务全红(本机因为文件本来就是 LF 而没暴露)。
现在比较与写入都与行尾无关:CRLF 检出照常通过,写回时保持该文件原有行尾,不产生\r\r\n。 - 新增
.gitattributes(* text=auto eol=lf,图片与压缩包标 binary),仓库不再随检出机器的行尾设置变形。 - 自测仍是 449 passed / 0 failed;另外用「把 README 转成 CRLF 再跑
--check」复现并验证了这次修复。
English
Fixes a regression that only showed up on CI: the bilingual sync treated a CRLF checkout as out of sync.
- The
tools/sync-bilingual.mjsadded in 4.6.0 assumed\nline endings. A Windows runner with
core.autocrlf=truechecks the repo out with CRLF, so the self-test reportedREADME.md out of syncand all three
matrix jobs went red (locally the files were already LF, so it never showed). Comparison and writing are now
line-ending agnostic: a CRLF checkout passes, writing keeps the file's existing endings, and no\r\r\nis produced. - New
.gitattributes(* text=auto eol=lf, binaries marked) so the repository no longer changes shape with the
checkout machine's line-ending settings. - Still 449 passed / 0 failed, and the fix was reproduced by converting the README to CRLF and running
--check.