diff --git a/.gitattributes b/.gitattributes index 0c1edba3..e1a2d464 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,19 @@ # git 钩子文件必须保持 LF——autocrlf=true 检出会转 CRLF,bash 执行带 \r 的脚本即崩。 tools/hooks/* text eol=lf +# 全仓文本一律 LF 入库与检出——Windows core.autocrlf=true 会把工作区检出成 CRLF, +# 行尾一旦进入逐字符比对的字符串基线数据面(如测试内嵌的多行 golden 常量), +# 运行时基线(\n)与源码基线(\r\n)逐位比对必红。本规则让一切平台检出落 LF。 +* text=auto eol=lf +# 二进制面显式豁免(防 auto 误判转码损坏素材与基线图) +*.png binary +*.jpg binary +*.jpeg binary +*.webp binary +*.gif binary +*.ico binary +*.ogg binary +*.wav binary +*.mp3 binary +*.ttf binary +*.otf binary +*.zip binary