summaryrefslogtreecommitdiff
path: root/t/t3413-rebase-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/t3413-rebase-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/t3413-rebase-hook.sh')
-rwxr-xr-xt/t3413-rebase-hook.sh18
1 files changed, 6 insertions, 12 deletions
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index b4acb3be5c..9fab0d779b 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -41,12 +41,9 @@ test_expect_success 'rebase -i' '
'
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
'
test_expect_success 'pre-rebase hook gets correct input (1)' '
@@ -102,12 +99,9 @@ test_expect_success 'pre-rebase hook gets correct input (6)' '
'
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 (1)' '