chainlint: let here-doc and multi-line string commence on same line
[gitweb.git] / t / t5406-remote-rejects.sh
index 46b2cb4e46d9d8bb2ae8cf2ea5d6b03331d4ac05..ff06f99649e4f09b88716ffef27e1aa12519c3a4 100755 (executable)
@@ -6,8 +6,9 @@ test_description='remote push rejects are reported by client'
 
 test_expect_success 'setup' '
        mkdir .git/hooks &&
-       (echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update &&
-       chmod +x .git/hooks/update &&
+       write_script .git/hooks/update <<-\EOF &&
+       exit 1
+       EOF
        echo 1 >file &&
        git add file &&
        git commit -m 1 &&
@@ -17,7 +18,7 @@ test_expect_success 'setup' '
        git commit -a -m 2
 '
 
-test_expect_success 'push reports error' '! git push 2>stderr'
+test_expect_success 'push reports error' 'test_must_fail git push 2>stderr'
 
 test_expect_success 'individual ref reports error' 'grep rejected stderr'