t5406: use write_script() instead of birthing shell script manually

Take advantage of write_script() to abstract-away details of shell script creation, thus allowing the reader to focus on script content. Readability benefits, particularly in this case, since the script body was buried in a noisy one-liner subshell responsible for emitting boilerplate and body. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jul 1, 2018 at 20:23 UTC fb23bd7af232d05d415653dc4d80b634a428f76f
1 file changed +3 -2
t/t5406-remote-rejects.sh
+3 -2
@@ -6,8 +6,9 @@ test_description='remote push rejects are reported by client'
6
7 test_expect_success 'setup' '
8 mkdir .git/hooks &&
9 - (echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update &&
10 - chmod +x .git/hooks/update &&
9 + write_script .git/hooks/update <<-\EOF &&
10 + exit 1
11 + EOF
12 echo 1 >file &&
13 git add file &&
14 git commit -m 1 &&