Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/gitmerge-safe-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" </dev/null >"$out" 2>&1 && exit 1
grep -q 'interactive terminal' "$out"
rm -f "$out"
)

echo "[10/10] TTY gate precedes network fetch"
Expand Down
Loading