{"thread":{"id":"12556","subject":"[PATCH] t5300: add test for \"index-pack --strict\"","startedAt":"2008-03-07T07:39:53Z","lastAt":"2008-03-07T07:39:53Z","messageCount":1,"participants":["Martin Koegler"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"71320","messageId":"12048755932645-git-send-email-mkoegler@auto.tuwien.ac.at","threadId":"12556","inReplyTo":null,"subject":"[PATCH] t5300: add test for \"index-pack --strict\"","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2008-03-07T07:39:53Z","receivedAt":"2008-03-07T07:39:53Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"This adds test for indexing packs with --strict option,\nbasically the same as c0e809e5c027443d6f77714a1c5f8c6233ca0a20\ndo for unpack-objects.\n\nSigned-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>\n---\n t/t5300-pack-object.sh |   47 +++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 47 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 7647f21..007b136 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -322,4 +322,51 @@ test_expect_success 'unpacking with --strict' '\n \t)\n '\n \n+test_expect_success 'index-pack with --strict' '\n+\n+\tfor j in a b c d e f g\n+\tdo\n+\t\tfor i in 0 1 2 3 4 5 6 7 8 9\n+\t\tdo\n+\t\t\to=$(echo $j$i | git hash-object -w --stdin) &&\n+\t\t\techo \"100644 $o\t0 $j$i\"\n+\t\tdone\n+\tdone >LIST &&\n+\trm -f .git/index &&\n+\tgit update-index --index-info <LIST &&\n+\tLIST=$(git write-tree) &&\n+\trm -f .git/index &&\n+\thead -n 10 LIST | git update-index --index-info &&\n+\tLI=$(git write-tree) &&\n+\trm -f .git/index &&\n+\ttail -n 10 LIST | git update-index --index-info &&\n+\tST=$(git write-tree) &&\n+\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n+\t\tgit pack-objects test-5 ) &&\n+\tPACK6=$( (\n+\t\t\techo \"$LIST\"\n+\t\t\techo \"$LI\"\n+\t\t\techo \"$ST\"\n+\t\t ) | git pack-objects test-6 ) &&\n+\ttest_create_repo test-7 &&\n+\t(\n+\t\tcd test-7 &&\n+\t\tgit index-pack --strict --stdin <../test-5-$PACK5.pack &&\n+\t\tgit ls-tree -r $LIST &&\n+\t\tgit ls-tree -r $LI &&\n+\t\tgit ls-tree -r $ST\n+\t) &&\n+\ttest_create_repo test-8 &&\n+\t(\n+\t\t# tree-only into empty repo -- many unreachables\n+\t\tcd test-8 &&\n+\t\ttest_must_fail git index-pack --strict --stdin <../test-6-$PACK6.pack\n+\t) &&\n+\t(\n+\t\t# already populated -- no unreachables\n+\t\tcd test-7 &&\n+\t\tgit index-pack --strict --stdin <../test-6-$PACK6.pack\n+\t)\n+'\n+\n test_done\n-- \ngitgui.0.9.3.ge659\n\n"}]}