Skip to content

Commit 71d5f93

Browse files
Michael Heemskerkgitster
authored andcommitted
t5500: add test for fetching with an unknown 'shallow'
When the client sends a 'shallow' line for an object that the server does not have, the server should just ignore it and let the client keep that unknown shallow boundary. Signed-off-by: Michael Heemskerk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af04fa2 commit 71d5f93

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t5500-fetch-pack.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,20 @@ test_expect_success 'clone shallow with packed refs' '
373373
test_cmp count8.expected count8.actual
374374
'
375375

376+
test_expect_success 'fetch in shallow repo unreachable shallow objects' '
377+
(
378+
git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&
379+
git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&
380+
cd no-reflog &&
381+
git tag -d TAGB1 TAGB2 &&
382+
git update-ref refs/heads/B B~~ &&
383+
git gc --prune=now &&
384+
cd ../shallow9 &&
385+
git fetch origin &&
386+
git fsck --no-dangling
387+
)
388+
'
389+
376390
test_expect_success 'setup tests for the --stdin parameter' '
377391
for head in C D E F
378392
do

0 commit comments

Comments
 (0)