From cd7b9ac5e170acf26ee63382a6a43ff94a11cefc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 14:45:06 +0000 Subject: [PATCH] test(pm): pin core.quotePath=true in the real-git quoted-path fixtures The CONTROL rows of the NUL-path fixtures in check-governed-queue-guard and check-governed-merges witness that git C-quotes the fixture names without -z. gitFreeEnv strips GIT_* but not a user or system gitconfig, so a box with core.quotePath=false spelled the non-ASCII name raw and reddened both CONTROL rows. Pin the setting on the fixture's own git command line, beside the identity pins it already carries; -c outranks every config file level. Claude-Session: https://claude.ai/code/session_01ADHkmSDNFF5uczb7BL5Bdf Co-authored-by: Claude --- scripts/pm/check-governed-merges.mjs | 6 ++++-- scripts/pm/check-governed-queue-guard.mjs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/pm/check-governed-merges.mjs b/scripts/pm/check-governed-merges.mjs index 9ad34ae40fc..eaf29e00f4f 100644 --- a/scripts/pm/check-governed-merges.mjs +++ b/scripts/pm/check-governed-merges.mjs @@ -8688,11 +8688,13 @@ async function selfTest() { // ⛔ #33620: governed paths git would C-quote, read through REAL git with a GIT_*-free environment (gitFreeEnv): // a non-ASCII name and a name holding a newline. Without `-z` each path list (--branch, the sweep's // commitChanges, the workflow split's ls-tree) spells them `"skills/a/\346\226\207\346\241\243.md"` and - // `"skills/a/two\nlines.md"`, which match no governed prefix. + // `"skills/a/two\nlines.md"`, which match no governed prefix. `core.quotePath=true` is pinned on the command line: + // gitFreeEnv strips GIT_* but not a user or system gitconfig, and `core.quotePath=false` there spells the non-ASCII + // names raw, which reds the CONTROL witness below. const quotedFx = mkdtempSync(join(tmpdir(), 'governed-merges-quoted-paths-')); try { const fg = (cwd, ...rest) => - execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], + execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', '-c', 'core.quotePath=true', ...rest], { cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] }); const repo = join(quotedFx, 'repo'); fg(quotedFx, 'init', '-q', repo); diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index 972cf695b12..a4f5989674e 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -3690,10 +3690,12 @@ export async function selfTest() { // ⛔ A governed path git would C-quote, read through REAL git (gitFreeEnv): a non-ASCII name and a name holding a // newline. Without `-z` the first prints as `"skills/a/\346\226\207\346\241\243.md"` and the second as // `"skills/a/two\nlines.md"`, quoted spellings that match no governed prefix, so the queue never saw the file. + // `core.quotePath=true` is pinned on the command line: gitFreeEnv strips GIT_* but not a user or system gitconfig, + // and a box set to `core.quotePath=false` spells the non-ASCII name raw, which reds the CONTROL witness below. const quotedDir = mkdtempSync(join(tmpdir(), 'guard-quoted-paths-')); try { const g = (args) => - execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...args], { + execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', '-c', 'core.quotePath=true', ...args], { cwd: quotedDir, encoding: 'utf8', env: gitFreeEnv(),