diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-05 23:58:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-05 23:58:43 -0800 |
commit | f2120eb4db3e3e3f9a336eb04fdc2319d7421536 (patch) | |
tree | da17eb49578d0413168d71931a840084ea6f6657 /t/t5541-http-push.sh | |
parent | e27d620e919f524ee0bfa0a4d1f35225d3cb867e (diff) | |
parent | 5238cbf65638d7a097bdb5ca8226f5acbe31f143 (diff) | |
download | git-f2120eb4db3e3e3f9a336eb04fdc2319d7421536.tar.gz |
Merge branch 'sp/smart-http-failure-to-push' into maint
* sp/smart-http-failure-to-push:
remote-curl: Fix push status report when all branches fail
Diffstat (limited to 't/t5541-http-push.sh')
-rwxr-xr-x | t/t5541-http-push.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index 6c9ec6f117..d66ed24508 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -96,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" <<EOF +#!/bin/sh +exit 1 +EOF +chmod a+x "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" + +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: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/ *$//" <act >cmp && + test_cmp exp cmp +' +rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" + cat >exp <<EOF GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 @@ -107,6 +133,8 @@ GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200 POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200 POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 +GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200 +POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 EOF test_expect_success 'used receive-pack service' ' sed -e " |