]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5407-post-rewrite-hook.sh
Merge branch 'gc/branch-recurse-submodules-fix'
[thirdparty/git.git] / t / t5407-post-rewrite-hook.sh
index 6da8d760e288dc4b4c75e661f99d2a4850320587..5f3ff051ca2fa3bba8beabbcb1491d5e69262f34 100755 (executable)
@@ -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