summaryrefslogtreecommitdiff
path: root/t/t5407-post-rewrite-hook.sh
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-17 11:13:15 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-03-17 08:40:26 -0700
commitc36c62859ae59e5ff3cd2a620ab8c906793dc615 (patch)
tree63335d9f7642da6c613e53bbd249467fcf41cb4c /t/t5407-post-rewrite-hook.sh
parenttests: change "mkdir -p && write_script" to use "test_hook" (diff)
downloadtgif-c36c62859ae59e5ff3cd2a620ab8c906793dc615.tar.xz
tests: use "test_hook" for misc "mkdir -p" and "chmod" cases
Make use of "test_hook" in various cases that didn't fit neatly into preceding commits. Here we need to indent blocks in addition to changing the test code, or to make other small cosmetic changes. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5407-post-rewrite-hook.sh')
-rwxr-xr-xt/t5407-post-rewrite-hook.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 6da8d760e2..5f3ff051ca 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -17,15 +17,13 @@ test_expect_success 'setup' '
git checkout A^0 &&
test_commit E bar E &&
test_commit F foo F &&
- git checkout main
-'
+ git checkout main &&
-cat >.git/hooks/post-rewrite <<EOF
-#!/bin/sh
-echo \$@ > "$TRASH_DIRECTORY"/post-rewrite.args
-cat > "$TRASH_DIRECTORY"/post-rewrite.data
-EOF
-chmod u+x .git/hooks/post-rewrite
+ test_hook --setup post-rewrite <<-EOF
+ echo \$@ > "$TRASH_DIRECTORY"/post-rewrite.args
+ cat > "$TRASH_DIRECTORY"/post-rewrite.data
+ EOF
+'
clear_hook_input () {
rm -f post-rewrite.args post-rewrite.data