fix(testbox): preserve git command contracts

This commit is contained in:
Vincent Koc
2026-07-10 20:39:27 -07:00
committed by Vincent Koc
parent 2843773be7
commit 1bb51a59af
2 changed files with 5 additions and 7 deletions
+3 -6
View File
@@ -459,15 +459,12 @@ function satisfiesMinimumCrabboxVersion(version, minimum) {
function gitOutput(commandArgs) {
const gitBinary = resolvePathBinary("git", process.env, process.platform) ?? "git";
const invocation = spawnInvocation(
gitBinary,
["-c", "core.excludesFile=/dev/null", ...commandArgs],
process.env,
process.platform,
);
const gitEnv = { ...process.env, GIT_CONFIG_GLOBAL: "/dev/null" };
const invocation = spawnInvocation(gitBinary, commandArgs, gitEnv, process.platform);
const result = spawnSync(invocation.command, invocation.args, {
cwd: repoRoot,
encoding: "utf8",
env: gitEnv,
stdio: ["ignore", "pipe", "pipe"],
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
});
+2 -1
View File
@@ -35,8 +35,9 @@ function optionValue(args, name, fallback = "") {
}
function git(repoRoot, args) {
return execFileSync("git", ["-c", "core.excludesFile=/dev/null", "-C", repoRoot, ...args], {
return execFileSync("git", ["-C", repoRoot, ...args], {
encoding: "utf8",
env: { ...process.env, GIT_CONFIG_GLOBAL: "/dev/null" },
}).trim();
}