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>
This commit is contained in:
committed by
Junio C Hamano
parent
bef805b7d8
commit
c36c62859a
@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user