summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b41860b)
raw | patch | inline | side by side (parent: b41860b)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 08:14:32 +0000 (00:14 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 18:53:11 +0000 (10:53 -0800) |
This adds test for unpacking deltified objects with --strict option.
- unpacking full trees with --strict should pass;
- unpacking only trees with --strict should be rejected due to
missing blobs;
- unpacking only trees with --strict into an existing
repository with necessary blobs should succeed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
- unpacking full trees with --strict should pass;
- unpacking only trees with --strict should be rejected due to
missing blobs;
- unpacking only trees with --strict into an existing
repository with necessary blobs should succeed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5300-pack-object.sh | patch | blob | history |
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index cd3c149800395553cc973317ef41e89e53771f60..ffc638ab2c7ac7bbf73db7e29bb3ec3c998e1594 100755 (executable)
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
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 &&
+ 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) &&
+ PACK5=$( git rev-list --objects "$LIST" "$LI" "$ST" | \
+ git pack-objects test-5 ) &&
+ PACK6=$( (
+ echo "$LIST"
+ echo "$LI"
+ echo "$ST"
+ ) | git pack-objects test-6 ) &&
+ test_create_repo test-5 &&
+ (
+ cd test-5 &&
+ git unpack-objects --strict <../test-5-$PACK5.pack &&
+ git ls-tree -r $LIST &&
+ git ls-tree -r $LI &&
+ git ls-tree -r $ST
+ ) &&
+ test_create_repo test-6 &&
+ (
+ # tree-only into empty repo -- many unreachables
+ cd test-6 &&
+ test_must_fail git unpack-objects --strict <../test-6-$PACK6.pack
+ ) &&
+ (
+ # already populated -- no unreachables
+ cd test-5 &&
+ git unpack-objects --strict <../test-6-$PACK6.pack
+ )
+'
+
test_done