From: Junio C Hamano Date: Tue, 29 Jan 2019 20:47:54 +0000 (-0800) Subject: Merge branch 'jk/proto-v2-hidden-refs-fix' X-Git-Tag: v2.21.0-rc0~68 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d3b017822d6b37523a9ee2d9d5bc9a2513221ae5?hp=-c Merge branch 'jk/proto-v2-hidden-refs-fix' The v2 upload-pack protocol implementation failed to honor hidden-ref configuration, which has been corrected. An earlier attempt reverted out of 'next'. * jk/proto-v2-hidden-refs-fix: upload-pack: support hidden refs with protocol v2 --- d3b017822d6b37523a9ee2d9d5bc9a2513221ae5 diff --combined t/t5512-ls-remote.sh index cd9e60632d,6547a394e7..ced15ae122 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@@ -204,6 -204,12 +204,12 @@@ test_expect_success 'overrides work bet grep refs/tags/magic actual ' + test_expect_success 'protocol v2 supports hiderefs' ' + test_config uploadpack.hiderefs refs/tags && + git -c protocol.version=2 ls-remote . >actual && + ! grep refs/tags actual + ' + test_expect_success 'ls-remote --symref' ' git fetch origin && cat >expect <<-EOF && @@@ -260,7 -266,7 +266,7 @@@ test_lazy_prereq GIT_DAEMON # This test spawns a daemon, so run it only if the user would be OK with # testing with git-daemon. test_expect_success PIPE,JGIT,GIT_DAEMON 'indicate no refs in standards-compliant empty remote' ' - JGIT_DAEMON_PORT=${JGIT_DAEMON_PORT-${this_test#t}} && + test_set_port JGIT_DAEMON_PORT && JGIT_DAEMON_PID= && git init --bare empty.git && >empty.git/git-daemon-export-ok && @@@ -302,28 -308,4 +308,28 @@@ test_expect_success 'ls-remote works ou nongit git ls-remote dst.git ' +test_expect_success 'ls-remote --sort fails gracefully outside repository' ' + # Use a sort key that requires access to the referenced objects. + nongit test_must_fail git ls-remote --sort=authordate "$TRASH_DIRECTORY" 2>err && + test_i18ngrep "^fatal: not a git repository, but the field '\''authordate'\'' requires access to object data" err +' + +test_expect_success 'ls-remote patterns work with all protocol versions' ' + git for-each-ref --format="%(objectname) %(refname)" \ + refs/heads/master refs/remotes/origin/master >expect && + git -c protocol.version=1 ls-remote . master >actual.v1 && + test_cmp expect actual.v1 && + git -c protocol.version=2 ls-remote . master >actual.v2 && + test_cmp expect actual.v2 +' + +test_expect_success 'ls-remote prefixes work with all protocol versions' ' + git for-each-ref --format="%(objectname) %(refname)" \ + refs/heads/ refs/tags/ >expect && + git -c protocol.version=1 ls-remote --heads --tags . >actual.v1 && + test_cmp expect actual.v1 && + git -c protocol.version=2 ls-remote --heads --tags . >actual.v2 && + test_cmp expect actual.v2 +' + test_done