Skip to content

Commit 8db43d2

Browse files
mhaggergitster
authored andcommitted
t5500: add tests of fetch-pack --all --depth=N $URL $REF
Document some bugs in "git fetch-pack": 1. If "git fetch-pack" is called with "--all", "--depth", and an explicit existing non-tag reference to fetch, then it falsely reports that the reference was not found, even though it was fetched correctly. 2. If "git fetch-pack" is called with "--all", "--depth", and an explicit existing tag reference to fetch, then it segfaults in filter_refs() because return_refs is used without having been initialized. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b08200 commit 8db43d2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/t5500-fetch-pack.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,19 @@ test_expect_success 'test missing ref before existing' '
427427
test_cmp expect-error error-me
428428
'
429429

430+
test_expect_failure 'test --all, --depth, and explicit head' '
431+
(
432+
cd client &&
433+
git fetch-pack --no-progress --all --depth=1 .. refs/heads/A
434+
) >out-adh 2>error-adh
435+
'
436+
437+
test_expect_failure 'test --all, --depth, and explicit tag' '
438+
git tag OLDTAG refs/heads/B~5 &&
439+
(
440+
cd client &&
441+
git fetch-pack --no-progress --all --depth=1 .. refs/tags/OLDTAG
442+
) >out-adt 2>error-adt
443+
'
444+
430445
test_done

0 commit comments

Comments
 (0)