diff --git a/tests/gitmerge-safe-smoke.sh b/tests/gitmerge-safe-smoke.sh index dfa8c5e..900521e 100755 --- a/tests/gitmerge-safe-smoke.sh +++ b/tests/gitmerge-safe-smoke.sh @@ -60,8 +60,15 @@ tmpdir="$(mktemp -d)" printf 'base\n' > file.txt git add file.txt git commit -qm base - "$MERGE_SCRIPT" >/tmp/gitmerge-safe-smoke.out 2>&1 && exit 1 - grep -q 'interactive terminal' /tmp/gitmerge-safe-smoke.out + # stdin must be redirected explicitly, not inherited. The gate is [[ -t 0 ]], + # so this step only proved anything when the suite happened to run without a + # TTY. Run from mqlaunch's SELF-CHECK in a real terminal the gate correctly + # passed, the script walked on to "No candidate branches found to merge", and + # the assertion below failed against a script that was behaving properly. + out="$(mktemp)" + "$MERGE_SCRIPT" "$out" 2>&1 && exit 1 + grep -q 'interactive terminal' "$out" + rm -f "$out" ) echo "[10/10] TTY gate precedes network fetch"