X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5541-http-push.sh;h=d66ed2450854c3091105a43bb2aa0f831140ed1f;hb=1b058bc30df5f79fe7449cacd8ae7128944327f7;hp=9b85d420c39a0f2192b6b829a6c7912ae28d8e92;hpb=6fee20df5c0f233415790cae4accf386fee67923;p=git.git diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index 9b85d420c..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