summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-17 15:02:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-17 15:02:23 -0700
commit76ccbdaf97c8f1e6d06e6ae37304822633b50678 (patch)
tree2fa393231a74193cb980a97e1cb78ac5dabf96e2 /t
parentMerge branch 'en/t3433-rebase-stat-dirty-failure' into maint (diff)
parentpartial-clone: avoid fetching when looking for objects (diff)
downloadtgif-76ccbdaf97c8f1e6d06e6ae37304822633b50678.tar.xz
Merge branch 'ds/partial-clone-fixes' into maint
Fix for a bug revealed by a recent change to make the protocol v2 the default. * ds/partial-clone-fixes: partial-clone: avoid fetching when looking for objects partial-clone: demonstrate bugs in partial fetch
Diffstat (limited to 't')
-rwxr-xr-xt/t5616-partial-clone.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index 9a9178fd28..3988a9cea2 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -384,6 +384,37 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
grep "want $(cat hash)" trace
'
+# The following two tests must be in this order, or else
+# the first will not fail. It is important that the srv.bare
+# repository did not have tags during clone, but has tags
+# in the fetch.
+
+test_expect_failure 'verify fetch succeeds when asking for new tags' '
+ git clone --filter=blob:none "file://$(pwd)/srv.bare" tag-test &&
+ for i in I J K
+ do
+ test_commit -C src $i &&
+ git -C src branch $i || return 1
+ done &&
+ git -C srv.bare fetch --tags origin +refs/heads/*:refs/heads/* &&
+ git -C tag-test -c protocol.version=2 fetch --tags origin
+'
+
+test_expect_success 'verify fetch downloads only one pack when updating refs' '
+ git clone --filter=blob:none "file://$(pwd)/srv.bare" pack-test &&
+ ls pack-test/.git/objects/pack/*pack >pack-list &&
+ test_line_count = 2 pack-list &&
+ for i in A B C
+ do
+ test_commit -C src $i &&
+ git -C src branch $i || return 1
+ done &&
+ git -C srv.bare fetch origin +refs/heads/*:refs/heads/* &&
+ git -C pack-test fetch origin &&
+ ls pack-test/.git/objects/pack/*pack >pack-list &&
+ test_line_count = 3 pack-list
+'
+
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd