Add testcase for needless objects during a shallow fetch
This is a testcase that checks for a problem where, during a specific shallow fetch where the client does not have any commits that are a successor of the new shallow root (i.e., the fetch creates a new detached piece of history), the server would simply send over _all_ objects, instead of taking into account the objects already present in the client. The actual problem was fixed by a recent patch series by Nguyễn Thái Ngọc Duy already. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthijs Kooijman committed
Aug 28, 2013 at 18:02 UTC
f21d2a786b7fa6e53bb09e6466185b26f7f30d98
1 file changed
+11
t/t5500-fetch-pack.sh
+11
@@ -393,6 +393,17 @@ test_expect_success 'fetch in shallow repo unreachable shallow objects' '
393
git fsck --no-dangling
394
)
395
'
396
+test_expect_success 'fetch creating new shallow root' '
397
+ (
398
+ git clone "file://$(pwd)/." shallow10 &&
399
+ git commit --allow-empty -m empty &&
400
+ cd shallow10 &&
401
+ git fetch --depth=1 --progress 2>actual &&
402
+ # This should fetch only the empty commit, no tree or
403
+ # blob objects
404
+ grep "remote: Total 1" actual
405
+ )
406
+'
407
408
test_expect_success 'setup tests for the --stdin parameter' '
409
for head in C D E F