LiveAgent
LiveAgent copied to clipboard
Windows 上创建 worktree 必然失败,全量测试也不通过
现象
- Windows 上创建 worktree 必然失败,报
fatal: could not create leading directories of '//?/C:/...'。 - Windows 上
cargo test有 23 个失败,前端全量有 4 个失败。这些失败被长期当成环境问题,上面那个真实 bug 也藏在里面。
原因
fs::canonicalize在 Windows 上返回\\?\路径,这个路径被直接传给了git worktree add。- 其余是测试假设:POSIX 路径、Windows 一定用 PowerShell、相对当前目录读源码、固定的总耗时上限。
- 还有一类和机器状态有关:有普通 Git Bash 在运行时,沙箱里的 Git Bash 进不去 msys 命名空间。
期望
Windows 上能创建和删除 worktree,全量测试通过。