]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3412-rebase-root.sh
tests: use "test_hook" for misc "mkdir -p" and "chmod" cases
[thirdparty/git.git] / t / t3412-rebase-root.sh
index 1e9f7833dd691a8b6ee769158c4684745dd4a8d4..58371d8a5477f47d53384a84ad0dae14457128d9 100755 (executable)
@@ -31,12 +31,9 @@ test_expect_success 'rebase --root fails with too many args' '
 '
 
 test_expect_success 'setup pre-rebase hook' '
-       mkdir -p .git/hooks &&
-       cat >.git/hooks/pre-rebase <<EOF &&
-#!$SHELL_PATH
-echo "\$1,\$2" >.git/PRE-REBASE-INPUT
-EOF
-       chmod +x .git/hooks/pre-rebase
+       test_hook --setup pre-rebase <<-\EOF
+       echo "$1,$2" >.git/PRE-REBASE-INPUT
+       EOF
 '
 cat > expect <<EOF
 4
@@ -141,12 +138,9 @@ commit work7~5
 EOF
 
 test_expect_success 'setup pre-rebase hook that fails' '
-       mkdir -p .git/hooks &&
-       cat >.git/hooks/pre-rebase <<EOF &&
-#!$SHELL_PATH
-false
-EOF
-       chmod +x .git/hooks/pre-rebase
+       test_hook --setup --clobber pre-rebase <<-\EOF
+       false
+       EOF
 '
 
 test_expect_success 'pre-rebase hook stops rebase' '