





















@@ -1,4 +1,4 @@
1-import { spawnSync } from "node:child_process";
1+import { execFileSync } from "node:child_process";
22import fs from "node:fs";
33import path from "node:path";
44import { describe, expect, it } from "vitest";
@@ -35,17 +35,6 @@ function makeEnv(overrides: Record<string, string | undefined> = {}) {
3535return env;
3636}
373738-function runGit(cwd: string, args: string[]) {
39-const result = spawnSync("git", args, {
40- cwd,
41-encoding: "utf8",
42-stdio: ["ignore", "pipe", "pipe"],
43-});
44-if (result.status !== 0) {
45-throw new Error(`git ${args.join(" ")} failed: ${result.stderr || result.stdout}`);
46-}
47-}
48-4938describe("local-heavy-check-runtime", () => {
5039it("reenables local heavy-check policy for local wrapper entrypoints", () => {
5140expect(resolveLocalHeavyCheckEnv({ OPENCLAW_LOCAL_CHECK: "0", PATH: "/usr/bin" })).toEqual({
@@ -376,7 +365,7 @@ describe("local-heavy-check-runtime", () => {
376365377366it("uses a worktree-local heavy-check lock when explicitly requested", () => {
378367const repoRoot = createTempDir("openclaw-local-heavy-check-worktree-");
379-runGit(repoRoot, ["init"]);
368+execFileSync("git", ["init"], { cwd: repoRoot, stdio: "ignore" });
380369const cwd = path.join(repoRoot, "nested", "tooling");
381370fs.mkdirSync(cwd, { recursive: true });
382371const commonLockDir = path.join(repoRoot, ".git", "openclaw-local-checks", "heavy-check.lock");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。