summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-01 06:15:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-01 06:15:35 (GMT)
commit026b8ef9f7ca69c2669fd092ca42bc5b6244f36d (patch)
tree68131e4bdcb92c8593a275d66785cc43c60457c4 /t/t5516-fetch-push.sh
parentd6e5484208cb48d0b35e7b89b7f74c490c855754 (diff)
parent6c301adb0a43bceef65e78df6936bd03a4d1933b (diff)
downloadgit-026b8ef9f7ca69c2669fd092ca42bc5b6244f36d.zip
git-026b8ef9f7ca69c2669fd092ca42bc5b6244f36d.tar.gz
git-026b8ef9f7ca69c2669fd092ca42bc5b6244f36d.tar.bz2
Merge branch 'bw/ref-prefix-for-configured-refspec'
* bw/ref-prefix-for-configured-refspec: fetch: do not pass ref-prefixes for fetch by exact SHA1
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index f4d2828..a5077d8 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1121,6 +1121,25 @@ test_expect_success 'fetch exact SHA1' '
)
'
+test_expect_success 'fetch exact SHA1 in protocol v2' '
+ mk_test testrepo heads/master hidden/one &&
+ git push testrepo master:refs/hidden/one &&
+ git -C testrepo config transfer.hiderefs refs/hidden &&
+ check_push_result testrepo $the_commit hidden/one &&
+
+ mk_child testrepo child &&
+ git -C child config protocol.version 2 &&
+
+ # make sure $the_commit does not exist here
+ git -C child repack -a -d &&
+ git -C child prune &&
+ test_must_fail git -C child cat-file -t $the_commit &&
+
+ # fetching the hidden object succeeds by default
+ # NEEDSWORK: should this match the v0 behavior instead?
+ git -C child fetch -v ../testrepo $the_commit:refs/heads/copy
+'
+
for configallowtipsha1inwant in true false
do
test_expect_success "shallow fetch reachable SHA1 (but not a ref), allowtipsha1inwant=$configallowtipsha1inwant" '