diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-02-18 03:25:57 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-18 03:25:57 +0400 |
commit | ce735bf7fd66c6404e86e5a313f35abc0394b838 (patch) | |
tree | ac1605c58fb6a3b12c90a4085cc6a0a7ada64da9 /t/t5516-fetch-push.sh | |
parent | abea4dc76a675d4ac0f27a2367256dc31981d1ca (diff) | |
parent | daebaa78137d59693a808c1f0bdec0ecb40fc12e (diff) |
Merge branch 'jc/hidden-refs'
Allow the server side to redact the refs/ namespace it shows to the
client.
Will merge to 'master'.
* jc/hidden-refs:
upload/receive-pack: allow hiding ref hierarchies
upload-pack: simplify request validation
upload-pack: share more code
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-x | t/t5516-fetch-push.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 8f024a08f0..c31e5c1c52 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1016,4 +1016,31 @@ test_expect_success 'push --prune refspec' ' ! check_push_result $the_first_commit tmp/foo tmp/bar ' +for configsection in transfer receive +do + test_expect_success "push to update a ref hidden by $configsection.hiderefs" ' + mk_test heads/master hidden/one hidden/two hidden/three && + ( + cd testrepo && + git config $configsection.hiderefs refs/hidden + ) && + + # push to unhidden ref succeeds normally + git push testrepo master:refs/heads/master && + check_push_result $the_commit heads/master && + + # push to update a hidden ref should fail + test_must_fail git push testrepo master:refs/hidden/one && + check_push_result $the_first_commit hidden/one && + + # push to delete a hidden ref should fail + test_must_fail git push testrepo :refs/hidden/two && + check_push_result $the_first_commit hidden/two && + + # idempotent push to update a hidden ref should fail + test_must_fail git push testrepo $the_first_commit:refs/hidden/three && + check_push_result $the_first_commit hidden/three + ' +done + test_done |