Skip to content

Commit cd7b9ac

Browse files
committed
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 <noreply@anthropic.com>
1 parent 895783a commit cd7b9ac

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎scripts/pm/check-governed-merges.mjs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8688,11 +8688,13 @@ async function selfTest() {
86888688
// ⛔ #33620: governed paths git would C-quote, read through REAL git with a GIT_*-free environment (gitFreeEnv):
86898689
// a non-ASCII name and a name holding a newline. Without `-z` each path list (--branch, the sweep's
86908690
// commitChanges, the workflow split's ls-tree) spells them `"skills/a/\346\226\207\346\241\243.md"` and
8691-
// `"skills/a/two\nlines.md"`, which match no governed prefix.
8691+
// `"skills/a/two\nlines.md"`, which match no governed prefix. `core.quotePath=true` is pinned on the command line:
8692+
// gitFreeEnv strips GIT_* but not a user or system gitconfig, and `core.quotePath=false` there spells the non-ASCII
8693+
// names raw, which reds the CONTROL witness below.
86928694
const quotedFx = mkdtempSync(join(tmpdir(), 'governed-merges-quoted-paths-'));
86938695
try {
86948696
const fg = (cwd, ...rest) =>
8695-
execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest],
8697+
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],
86968698
{ cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] });
86978699
const repo = join(quotedFx, 'repo');
86988700
fg(quotedFx, 'init', '-q', repo);

‎scripts/pm/check-governed-queue-guard.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3690,10 +3690,12 @@ export async function selfTest() {
36903690
// ⛔ A governed path git would C-quote, read through REAL git (gitFreeEnv): a non-ASCII name and a name holding a
36913691
// newline. Without `-z` the first prints as `"skills/a/\346\226\207\346\241\243.md"` and the second as
36923692
// `"skills/a/two\nlines.md"`, quoted spellings that match no governed prefix, so the queue never saw the file.
3693+
// `core.quotePath=true` is pinned on the command line: gitFreeEnv strips GIT_* but not a user or system gitconfig,
3694+
// and a box set to `core.quotePath=false` spells the non-ASCII name raw, which reds the CONTROL witness below.
36933695
const quotedDir = mkdtempSync(join(tmpdir(), 'guard-quoted-paths-'));
36943696
try {
36953697
const g = (args) =>
3696-
execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...args], {
3698+
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], {
36973699
cwd: quotedDir,
36983700
encoding: 'utf8',
36993701
env: gitFreeEnv(),

0 commit comments

Comments
 (0)