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>
This commit is contained in:
parent
fbd4a7036d
commit
f21d2a786b
@ -393,6 +393,17 @@ test_expect_success 'fetch in shallow repo unreachable shallow objects' '
|
|||||||
git fsck --no-dangling
|
git fsck --no-dangling
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
test_expect_success 'fetch creating new shallow root' '
|
||||||
|
(
|
||||||
|
git clone "file://$(pwd)/." shallow10 &&
|
||||||
|
git commit --allow-empty -m empty &&
|
||||||
|
cd shallow10 &&
|
||||||
|
git fetch --depth=1 --progress 2>actual &&
|
||||||
|
# This should fetch only the empty commit, no tree or
|
||||||
|
# blob objects
|
||||||
|
grep "remote: Total 1" actual
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'setup tests for the --stdin parameter' '
|
test_expect_success 'setup tests for the --stdin parameter' '
|
||||||
for head in C D E F
|
for head in C D E F
|
||||||
|
Loading…
Reference in New Issue
Block a user