mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix: percent escaping for git --format on Windows (#629)
* test(server): add real-spawn round-trip for % in argv RED test: pass --format=%(refname)... through spawnProcess to a child node script that echoes argv[2]. Asserts the child receives the original string verbatim. Wired into the Windows CI matrix to expose the escapeWindowsCmdValue %-doubling bug under cmd.exe. * test(server): use bare 'node' command so cmd.exe path is exercised process.execPath has both an extension and a path separator on Windows, so shouldUseWindowsShell returns false and the broken %-escape pipeline is never invoked. Use the bare command name 'node' instead. * fix(server): stop doubling % in cmd.exe arg escaping on Windows cmd.exe only collapses `%%` → `%` inside batch files; on the command line / via `cmd /c "..."` `%%` stays literal. Doubling `%` in escapeWindowsCmdValue meant args like `--format=%(refname)` reached git as `--format=%%(refname)`, which git interprets as the escape sequence for a literal `%`, so format atoms appeared verbatim and the branch picker showed `%(refname)%09%(committerdate:unix)` instead of branch names. Update unit tests that pinned the broken doubling behavior.
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -122,6 +122,7 @@ jobs:
|
||||
npx vitest run
|
||||
src/utils/executable.test.ts
|
||||
src/utils/spawn.launch-regression.test.ts
|
||||
src/utils/spawn.percent-escape.test.ts
|
||||
src/utils/spawn.test.ts
|
||||
src/utils/run-git-command.test.ts
|
||||
src/utils/checkout-git-rev-parse.test.ts
|
||||
|
||||
Reference in New Issue
Block a user