X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5541-http-push.sh;h=d66ed2450854c3091105a43bb2aa0f831140ed1f;hb=969fe57b844a514747c1d5d66e0698dc53ed473d;hp=a73c82635ff6fba6fcef4f139ff09205c1b9b6de;hpb=3686aa1caf907d22fe318c28efe93f0e7870ba50;p=git.git diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index a73c82635..d66ed2450 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -14,6 +14,7 @@ fi ROOT_PATH="$PWD" LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'} . "$TEST_DIRECTORY"/lib-httpd.sh +. "$TEST_DIRECTORY"/lib-terminal.sh start_httpd test_expect_success 'setup remote repository' ' @@ -95,6 +96,32 @@ 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" <exp < dev2 (hook declined) +error: failed to push some refs to 'http://127.0.0.1:5541/smart/test_repo.git' +EOF + +test_expect_success 'rejected update prints status' ' + cd "$ROOT_PATH"/test_repo_clone && + git checkout -b dev2 && + : >path4 && + git add path4 && + test_tick && + git commit -m dev2 && + test_must_fail git push origin dev2 2>act && + sed -e "/^remote: /s/ *$//" cmp && + test_cmp exp cmp +' +rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" + cat >exp <&1 | tee output && + test_cmp /dev/null output +' + stop_httpd test_done