Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-17 13:13:15 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-17 18:40:26 +0300
commitc36c62859ae59e5ff3cd2a620ab8c906793dc615 (patch)
tree63335d9f7642da6c613e53bbd249467fcf41cb4c /t/t5541-http-push-smart.sh
parentbef805b7d8eed8ab5ee20128acf636a95bcba1f2 (diff)
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/t5541-http-push-smart.sh')
-rwxr-xr-xt/t5541-http-push-smart.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 8ca50f8b18..ab4b5cfcd1 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -96,18 +96,18 @@ test_expect_success 'create and delete remote branch' '
test_must_fail git show-ref --verify refs/remotes/origin/dev
'
-cat >"$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" <<EOF
-#!/bin/sh
-exit 1
-EOF
-chmod a+x "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update"
+test_expect_success 'setup rejected update hook' '
+ test_hook --setup -C "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git" update <<-\EOF &&
+ exit 1
+ EOF
-cat >exp <<EOF
-remote: error: hook declined to update refs/heads/dev2
-To http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git
- ! [remote rejected] dev2 -> dev2 (hook declined)
-error: failed to push some refs to 'http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git'
-EOF
+ cat >exp <<-EOF
+ remote: error: hook declined to update refs/heads/dev2
+ To http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git
+ ! [remote rejected] dev2 -> dev2 (hook declined)
+ error: failed to push some refs to '\''http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git'\''
+ EOF
+'
test_expect_success 'rejected update prints status' '
cd "$ROOT_PATH"/test_repo_clone &&