Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/pm/check-governed-merges.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion scripts/pm/check-governed-queue-guard.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading