summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:15 (GMT)
commit9c96ab987243724915fedd7ea051438b8e553e07 (patch)
treedb510f7ef3762672972dd23b2be64cda759e26a2 /t
parente5eac5735609722a07401a279a1508ace22fc9bc (diff)
parente2f41a0a5aaa0116c9f1463fd779ce832eb773cc (diff)
downloadgit-9c96ab987243724915fedd7ea051438b8e553e07.zip
git-9c96ab987243724915fedd7ea051438b8e553e07.tar.gz
git-9c96ab987243724915fedd7ea051438b8e553e07.tar.bz2
Merge branch 'jt/namespaced-ls-refs-fix'
Fix namespace support in protocol v2. * jt/namespaced-ls-refs-fix: ls-refs: filter refs using namespace-stripped name
Diffstat (limited to 't')
-rwxr-xr-xt/t5702-protocol-v2.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 7ca1aab..db4ae09 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -561,6 +561,27 @@ test_expect_success 'fetch with http:// using protocol v2' '
grep "git< version 2" log
'
+test_expect_success 'fetch from namespaced repo respects namespaces' '
+ test_when_finished "rm -f log" &&
+
+ git init "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" &&
+ test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" one &&
+ test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" two &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" \
+ update-ref refs/namespaces/ns/refs/heads/master one &&
+
+ GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
+ fetch "$HTTPD_URL/smart_namespace/nsrepo" \
+ refs/heads/master:refs/heads/theirs &&
+
+ # Server responded using protocol v2
+ grep "fetch< version 2" log &&
+
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" rev-parse one >expect &&
+ git -C http_child rev-parse theirs >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'push with http:// and a config of v2 does not request v2' '
test_when_finished "rm -f log" &&
# Till v2 for push is designed, make sure that if a client has