Repository navigation
Conversation
📊 Automated PR Analysis
SummaryFixes a Windows bug where MSYS/MinGW child processes (git.exe, rg.exe) misinterpreted globify metacharacters (, ?, [, {, ) in arguments, causing pathspecs like ":(exclude).lock" to be incorrectly expanded against the working directory. The fix quotes such arguments using cmd_RawArg in resolved_command when they contain these metacharacters but no whitespace/quotes, and adds unit and integration tests. Review Checklist
Linked issues: #4737 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Thanks for this, and for the integration test with a real MSYS grep, that's the right way to pin it. I ran it natively on Windows (MSVC build, Git for Windows 2.56, throwaway dirs), from both a real Git Bash and PowerShell, against develop and #4260, which takes the same approach with a shorter character list. It fixes real things. Adding
#4103 avoids the first two: it leaves |
Summary
resolved_command(src/core/utils.rs) usingcmd_RawArgwhen an argument contains MSYS/MinGW runtimeglobifymetacharacters (*,?,[,{,\) and no whitespace/quotes, preventing MSYS2/Git-for-Windows children (git.exe,rg.exe, etc.) from mis-expanding pathspecs like:(exclude)*.lockor regex character classes[0-9]against the working directory.src/core/utils.rsandtests/windows_child_quoting_test.rs.Test plan
cargo test --lib core::utils::rtk git diff -- ":(exclude)*.lock"argument quoting verified