This adds a test for unpacking deltified objects with --strict option. Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> --- Junio C Hamano <gitster@xxxxxxxxx> writes: > Sergey Vlasov <vsu@xxxxxxxxxxx> writes: > ... >> However, I do not have time to create a proper test case for this. > > That's Ok. What we need is a fix but it is not that urgent as the stuff > is now reverted for now. t/t5300-pack-object.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index cd3c149..0cf0ff7 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -274,4 +274,40 @@ test_expect_success \ packname_4=$(git pack-objects test-4 <obj-list) && test 3 = $(ls test-4-*.pack | wc -l)' +test_expect_failure 'unpacking with --strict' ' + + git config --unset pack.packsizelimit && + COPYING=$(git hash-object -w ../../COPYING) && + for j in a b c d e f g + do + for i in 0 1 2 3 4 5 6 7 8 9 + do + o=$(echo $j$i | git hash-object -w --stdin) && + echo "100644 $o 0 $j$i" + done + done >LIST && + rm -f .git/index && + git update-index --index-info <LIST && + LIST=$(git write-tree) && + rm -f .git/index && + head -n 10 LIST | git update-index --index-info && + LI=$(git write-tree) && + rm -f .git/index && + tail -n 10 LIST | git update-index --index-info && + ST=$(git write-tree) && + PACK=$( ( + echo "$LIST" + echo "$LI" + echo "$ST" + ) | git pack-objects test-5 ) && + + test_create_repo another && + + ( + cd another && + git unpack-objects --strict <../test-5-$PACK.pack + ) + +' + test_done -- 1.5.4.3.529.gb25fb -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html