diff options
Diffstat (limited to 't/t5541-http-push-smart.sh')
-rwxr-xr-x | t/t5541-http-push-smart.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 4c970787b0..afc680d5e3 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -49,7 +49,7 @@ test_expect_success 'no empty path components' ' # NEEDSWORK: If the overspecification of the expected result is reduced, we # might be able to run this test in all protocol versions. - if test -z "$GIT_TEST_PROTOCOL_VERSION" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then check_access_log exp fi @@ -135,7 +135,7 @@ EOF test_expect_success 'used receive-pack service' ' # NEEDSWORK: If the overspecification of the expected result is reduced, we # might be able to run this test in all protocol versions. - if test -z "$GIT_TEST_PROTOCOL_VERSION" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then check_access_log exp fi @@ -177,6 +177,9 @@ test_expect_success 'push (chunked)' ' test $HEAD = $(git rev-parse --verify HEAD)) ' +## References of remote: atomic1(1) master(2) collateral(2) other(2) +## References of local : atomic2(2) master(1) collateral(3) other(2) collateral1(3) atomic(1) +## Atomic push : master(1) collateral(3) atomic(1) test_expect_success 'push --atomic also prevents branch creation, reports collateral' ' # Setup upstream repo - empty for now d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git && @@ -189,7 +192,8 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat test_commit atomic2 && git branch collateral && git branch other && - git push "$up" master collateral other && + git push "$up" atomic1 master collateral other && + git tag -d atomic1 && # collateral is a valid push, but should be failed by atomic push git checkout collateral && @@ -224,7 +228,11 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat # the collateral failure refs should be indicated to the user grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output && - grep "^ ! .*rejected.* collateral -> collateral .*atomic push failed" output + grep "^ ! .*rejected.* collateral -> collateral .*atomic push failed" output && + + # never report what we do not push + ! grep "^ ! .*rejected.* atomic1 " output && + ! grep "^ ! .*rejected.* other " output ' test_expect_success 'push --atomic fails on server-side errors' ' |