Repository navigation
chore(repo): normalize checkout line endings to LF - #611
Merged
Merged
Conversation
Windows checks out every text file as CRLF when core.autocrlf is true, the Git for Windows default. Tests that read source text, or that load the MCP bundle, then fail on a clean clone: the V2 suite reports 14 failing files. Adding .gitattributes with "text=auto eol=lf" keeps the working tree at LF regardless of the local core.autocrlf setting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概述
关联 #610。
Windows 上
core.autocrlf默认为true,仓库又没有.gitattributes,所有文本文件在检出时会变成 CRLF。这会破坏两类测试:\n片段的用例;bin/agent-recall-mcp.mjs的用例——vite/esbuild 转换 CRLF 文件时报SyntaxError,整个测试文件无法加载。本次改动只新增根目录
.gitattributes(* text=auto eol=lf),把工作区行尾固定为 LF,不再依赖本地的core.autocrlf设置。更新说明检查
.release-notes/windows-line-endings.mdrelease-target: v2(观察到的失败集中在 V2 测试;.gitattributes本身是仓库级路径)npm run release-note:check,在干净工作树中通过(0 feature(s), 1 fix(es))验证
改动前(
core.autocrlf=true、干净 clone、未加.gitattributes):npm run test:v2:289 个测试文件,14 个失败文件 / 17 个失败用例。src/core/indexer.test.ts、src/core/mcp-server.test.ts、src/core/session-search-query.test.ts、src/core/postgres/session-repository.test.ts整个套件加载失败;src/main/live-session-worker-wiring.test.ts断言源码文本失败。bin/agent-recall-mcp.mjs转为 LF(其余不动),src/core/indexer.test.ts立即整体通过。改动后(
core.autocrlf=true+.gitattributes,已确认工作区文件为 LF):npm run typecheck通过。未运行:改动后的完整
npm run test:v2。本机执行完整套件时有其它高负载进程,出现大面积 5s 超时,数据不可信。剩余失败属于另一类 Windows 问题(测试写死 POSIX 路径、ENOTEMPTY清理、超时),已在 #610 中列为后续项,不在本次范围内。