Junio C Hamano <gitster@xxxxxxxxx> writes: > Junio C Hamano <gitster@xxxxxxxxx> writes: > >> "Strawbridge, Michael" <Michael.Strawbridge@xxxxxxx> writes: >> >>> +test_expect_success $PREREQ "--validate hook supports header argument" ' >>> + test_when_finished "rm my-hooks.ran" && >>> + write_script my-hooks/sendemail-validate <<-\EOF && >>> + filesize=$(stat -c%s "$2") >> >> That "stat -c" is a GNU-ism, I think. macOS CI jobs at GitHub do >> not seem to like it. >> >>> + if [ "$filesize" != "0" ]; then >> >> Also, please see Documentation/CodingGuidelines to learn the subset >> of shell script syntax and style we adopted for this project. I'll tentatively queue this as a fix-up on top of the topic, but is this testing the right thing? Should we inspect "$2" and verify that it gives us what we expect, not just it being non-empty? t/t9001-send-email.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git c/t/t9001-send-email.sh w/t/t9001-send-email.sh index f02b1eba16..b19997cbbc 100755 --- c/t/t9001-send-email.sh +++ w/t/t9001-send-email.sh @@ -568,9 +568,10 @@ test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" ' test_expect_success $PREREQ "--validate hook supports header argument" ' test_when_finished "rm my-hooks.ran" && write_script my-hooks/sendemail-validate <<-\EOF && - filesize=$(stat -c%s "$2") - if [ "$filesize" != "0" ]; then - >my-hooks.ran + rm -f my-hooks.ran + if test -s "$2" + then + >my-hooks.ran fi exit 1 EOF