fix(bins): Windows-safe GIT_CEILING join; next-version probes the full default-base chain

GIT_CEILING_DIRECTORIES was joined with ':' — git on Windows splits on
';' and drive letters contain ':', silently disabling the #2144
second-layer defense there; now path.delimiter. next-version's
default-base detection only tried origin/HEAD then 'main', diverging
from the canonical 4-step chain diff-scope uses — origin/main and
origin/master probes added, pinned by fixture repos.
This commit is contained in:
Garry Tan
2026-08-14 17:15:48 -07:00
parent 2fd506a4e0
commit c9215c438c
3 changed files with 122 additions and 5 deletions
+4 -2
View File
@@ -54,7 +54,7 @@ import {
rmSync,
realpathSync,
} from "fs";
import { join, basename, dirname } from "path";
import { join, basename, dirname, delimiter } from "path";
import { execFileSync, spawnSync, spawn, type ChildProcess } from "child_process";
import { homedir } from "os";
import { createHash } from "crypto";
@@ -1443,8 +1443,10 @@ function runGbrainImport(
}
const baseEnv: NodeJS.ProcessEnv = {
...process.env,
// path.delimiter, not ':' — git splits this on ';' on Windows, and
// drive-letter paths contain ':' themselves.
GIT_CEILING_DIRECTORIES: process.env.GIT_CEILING_DIRECTORIES
? `${ceiling}:${process.env.GIT_CEILING_DIRECTORIES}`
? `${ceiling}${delimiter}${process.env.GIT_CEILING_DIRECTORIES}`
: ceiling,
};
const child = spawnGbrainAsync(