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(),