From 42d1201e24890ff9fa9b4b06427adff72d176ac2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:01:12 -1000 Subject: Keep the robustness tests to portable shell An unquoted $cgitbin breaks in a checkout whose path holds a space, and head -c and head -1 are not POSIX. The status of the disconnected request is still read right after its pipeline, which assumes the shell waits for the left side as dash, bash, ksh and busybox ash all do. --- tests/t0301-security.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/t0301-security.sh') diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index f7befe8..4626c2c 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -135,8 +135,8 @@ test_expect_success 'no page carries an inline handler' ' # upstream covers it. test_expect_success 'tree groups directories before files' ' cgit_rc seccgitrc "url=sec/tree/" >tmp && - dirline=$(grep -n "tree/zsub" tmp | head -1 | cut -d: -f1) && - fileline=$(grep -n "tree/afile" tmp | head -1 | cut -d: -f1) && + dirline=$(grep -n "tree/zsub" tmp | head -n 1 | cut -d: -f1) && + fileline=$(grep -n "tree/afile" tmp | head -n 1 | cut -d: -f1) && test -n "$dirline" && test -n "$fileline" && test "$dirline" -lt "$fileline" -- cgit 2.12.1