]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5601-clone.sh
tests: change "cat && chmod +x" to use "test_hook"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 17 Mar 2022 10:13:13 +0000 (11:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Mar 2022 15:40:26 +0000 (08:40 -0700)
commit60a8a6bf6cf2cd7c8c0524c711df50dd5c2ace4f
tree2bc1ce029d60132c1b625445d00e4b77cea11ba0
parentd7ef03681fbcbd0314d91c71d60f79a51338690a
tests: change "cat && chmod +x" to use "test_hook"

Refactor various test code to use the "test_hook" helper. This change:

 - Fixes the long-standing issues with those tests using "#!/bin/sh"
   instead of "#!$SHELL_PATH". Using "#!/bin/sh" here happened to work
   because this code was so simple that it e.g. worked on Solaris
   /bin/sh.

 - Removes the "mkdir .git/hooks" invocation, as explained in a
   preceding commit we'll rely on the default templates to create that
   directory for us.

For the test in "t5402-post-merge-hook.sh" it's easier and more
correct to unroll the for-loop into a test_expect_success, so let's do
that.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5402-post-merge-hook.sh
t/t5601-clone.sh