(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"test quickfetch from local">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\n"> <"\ttest_tick &&\n"> <"\techo ichi >file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m initial &&\n"> <"\n"> <"\tcnt=$( (\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 3\n"> ) } ) (C {(test_expect_success)} {(SQ <"clone without alternate">)} { (SQ <"\n"> <"\n"> <"\t(\n"> <"\t\tmkdir cloned &&\n"> <"\t\tcd cloned &&\n"> <"\t\tgit init-db &&\n"> <"\t\tgit remote add -f origin ..\n"> <"\t) &&\n"> <"\tcnt=$( (\n"> <"\t\tcd cloned &&\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 3\n"> ) } ) (C {(test_expect_success)} {(SQ <"further commits in the original">)} { (SQ <"\n"> <"\n"> <"\ttest_tick &&\n"> <"\techo ni >file &&\n"> <"\tgit commit -a -m second &&\n"> <"\n"> <"\tcnt=$( (\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 6\n"> ) } ) (C {(test_expect_success)} {(SQ <"copy commit and tree but not blob by hand">)} { (SQ <"\n"> <"\n"> <"\tgit rev-list --objects HEAD |\n"> <"\tgit pack-objects --stdout |\n"> <"\t(\n"> <"\t\tcd cloned &&\n"> <"\t\tgit unpack-objects\n"> <"\t) &&\n"> <"\n"> <"\tcnt=$( (\n"> <"\t\tcd cloned &&\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 6 &&\n"> <"\n"> <"\tblob=$(git rev-parse HEAD:file | sed -e \"s|..|&/|\") &&\n"> <"\ttest -f \"cloned/.git/objects/$blob\" &&\n"> <"\trm -f \"cloned/.git/objects/$blob\" &&\n"> <"\n"> <"\tcnt=$( (\n"> <"\t\tcd cloned &&\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 5\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"quickfetch should not leave a corrupted repository">)} { (SQ <"\n"> <"\n"> <"\t(\n"> <"\t\tcd cloned &&\n"> <"\t\tgit fetch\n"> <"\t) &&\n"> <"\n"> <"\tcnt=$( (\n"> <"\t\tcd cloned &&\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\ttest $cnt -eq 6\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"quickfetch should not copy from alternate">)} { (SQ <"\n"> <"\n"> <"\t(\n"> <"\t\tmkdir quickclone &&\n"> <"\t\tcd quickclone &&\n"> <"\t\tgit init-db &&\n"> <"\t\t(cd ../.git/objects && pwd) >.git/objects/info/alternates &&\n"> <"\t\tgit remote add origin .. &&\n"> <"\t\tgit fetch -k -k\n"> <"\t) &&\n"> <"\tobj_cnt=$( (\n"> <"\t\tcd quickclone &&\n"> <"\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n"> <"\t) ) &&\n"> <"\tpck_cnt=$( (\n"> <"\t\tcd quickclone &&\n"> <"\t\tgit count-objects -v | sed -n -e \"/packs:/{\n"> <"\t\t\t\ts/packs://\n"> <"\t\t\t\tp\n"> <"\t\t\t\tq\n"> <"\t\t\t}\"\n"> <"\t) ) &&\n"> <"\torigin_master=$( (\n"> <"\t\tcd quickclone &&\n"> <"\t\tgit rev-parse origin/master\n"> <"\t) ) &&\n"> <"\techo \"loose objects: $obj_cnt, packfiles: $pck_cnt\" &&\n"> <"\ttest $obj_cnt -eq 0 &&\n"> <"\ttest $pck_cnt -eq 0 &&\n"> <"\ttest z$origin_master = z$(git rev-parse master)\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"quickfetch should handle ~1000 refs (on Windows)">)} { (SQ <"\n"> <"\n"> <"\tgit gc &&\n"> <"\thead=$(git rev-parse HEAD) &&\n"> <"\tbranchprefix=\"$head refs/heads/branch\" &&\n"> <"\tfor i in 0 1 2 3 4 5 6 7 8 9; do\n"> <"\t\tfor j in 0 1 2 3 4 5 6 7 8 9; do\n"> <"\t\t\tfor k in 0 1 2 3 4 5 6 7 8 9; do\n"> <"\t\t\t\techo \"$branchprefix$i$j$k\" >> .git/packed-refs\n"> <"\t\t\tdone\n"> <"\t\tdone\n"> <"\tdone &&\n"> <"\t(\n"> <"\t\tcd cloned &&\n"> <"\t\tgit fetch &&\n"> <"\t\tgit fetch\n"> <"\t)\n"> <"\n"> ) } ) (C {(test_done)}) ] )