Files
stack/agents/darkwing/work/queue-48-review/r1/mut/delay-exit.diff
T
2026-10-10 03:49:12 -05:00

14 lines
1.0 KiB
Diff

diff --git a/packages/queue/tests/commit.test.mjs b/packages/queue/tests/commit.test.mjs
index c254dce5..b101cebc 100644
--- a/packages/queue/tests/commit.test.mjs
+++ b/packages/queue/tests/commit.test.mjs
@@ -166,7 +166,7 @@ async function pausedCommit(t, form) {
const go = join(r.ctl, "editor-go");
const editor = join(r.ctl, "editor.sh");
writeFileSync(editor, `#!/bin/sh\n: > ${q(started)}\nwhile [ ! -e ${q(go)} ]; do sleep 0.05; done\necho "ordinary" > "$1"\n`, { mode: 0o755 });
- const child = spawn("git", ["-C", r.root, "commit", "-e", "-q", ...form], { env: { ...r.env, GIT_EDITOR: editor }, stdio: ["ignore", "pipe", "pipe"] });
+ const child = spawn("sh", ["-c", 'git "$@" 2>"$0"; s=$?; (sleep 0.5; cat "$0" >&2) & exit $s', join(r.ctl, "git-err"), "-C", r.root, "commit", "-e", "-q", ...form], { env: { ...r.env, GIT_EDITOR: editor }, stdio: ["ignore", "pipe", "pipe"] });
let childErr = "";
child.stderr.on("data", (d) => { childErr += d; });
const exited = new Promise((resolve) => child.on("exit", resolve));