mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
fix(testbox): preserve git command contracts
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user