(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"test git fast-import unpack limit">)} spids: [3] ) ] spids: [3] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <"create loose objects on import">)} { (SQ <"\n"> <"\ttest_tick &&\n"> <"\tcat >input <<-INPUT_END &&\n"> <"\tcommit refs/heads/master\n"> <"\tcommitter $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\n"> <"\tdata <<COMMIT\n"> <"\tinitial\n"> <"\tCOMMIT\n"> <"\n"> <"\tdone\n"> <"\tINPUT_END\n"> <"\n"> <"\tgit -c fastimport.unpackLimit=2 fast-import --done <input &&\n"> <"\tgit fsck --no-progress &&\n"> <"\ttest $(find .git/objects/?? -type f | wc -l) -eq 2 &&\n"> <"\ttest $(find .git/objects/pack -type f | wc -l) -eq 0\n"> ) } ) (C {(test_expect_success)} {(SQ <"bigger packs are preserved">)} { (SQ <"\n"> <"\ttest_tick &&\n"> <"\tcat >input <<-INPUT_END &&\n"> <"\tcommit refs/heads/master\n"> <"\tcommitter $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\n"> <"\tdata <<COMMIT\n"> <"\tincremental should create a pack\n"> <"\tCOMMIT\n"> <"\tfrom refs/heads/master^0\n"> <"\n"> <"\tcommit refs/heads/branch\n"> <"\tcommitter $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\n"> <"\tdata <<COMMIT\n"> <"\tbranch\n"> <"\tCOMMIT\n"> <"\n"> <"\tdone\n"> <"\tINPUT_END\n"> <"\n"> <"\tgit -c fastimport.unpackLimit=2 fast-import --done <input &&\n"> <"\tgit fsck --no-progress &&\n"> <"\ttest $(find .git/objects/?? -type f | wc -l) -eq 2 &&\n"> <"\ttest $(find .git/objects/pack -type f | wc -l) -eq 2\n"> ) } ) (C {(test_expect_success)} {(SQ <"lookups after checkpoint works">)} { (SQ <"\n"> <"\thello_id=$(echo hello | git hash-object --stdin -t blob) &&\n"> <"\tid=\"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\" &&\n"> <"\tbefore=$(git rev-parse refs/heads/master^0) &&\n"> <"\t(\n"> <"\t\tcat <<-INPUT_END &&\n"> <"\t\tblob\n"> <"\t\tmark :1\n"> <"\t\tdata 6\n"> <"\t\thello\n"> <"\n"> <"\t\tcommit refs/heads/master\n"> <"\t\tmark :2\n"> <"\t\tcommitter $id\n"> <"\t\tdata <<COMMIT\n"> <"\t\tcheckpoint after this\n"> <"\t\tCOMMIT\n"> <"\t\tfrom refs/heads/master^0\n"> <"\t\tM 100644 :1 hello\n"> <"\n"> <"\t\t# pre-checkpoint\n"> <"\t\tcat-blob :1\n"> <"\t\tcat-blob $hello_id\n"> <"\t\tcheckpoint\n"> <"\t\t# post-checkpoint\n"> <"\t\tcat-blob :1\n"> <"\t\tcat-blob $hello_id\n"> <"\t\tINPUT_END\n"> <"\n"> <"\t\tn=0 &&\n"> <"\t\tfrom=$before &&\n"> <"\t\twhile test x\"$from\" = x\"$before\"\n"> <"\t\tdo\n"> <"\t\t\tif test $n -gt 30\n"> <"\t\t\tthen\n"> <"\t\t\t\techo >&2 \"checkpoint did not update branch\"\n"> <"\t\t\t\texit 1\n"> <"\t\t\telse\n"> <"\t\t\t\tn=$(($n + 1))\n"> <"\t\t\tfi &&\n"> <"\t\t\tsleep 1 &&\n"> <"\t\t\tfrom=$(git rev-parse refs/heads/master^0)\n"> <"\t\tdone &&\n"> <"\t\tcat <<-INPUT_END &&\n"> <"\t\tcommit refs/heads/master\n"> <"\t\tcommitter $id\n"> <"\t\tdata <<COMMIT\n"> <"\t\tmake sure from \"unpacked sha1 reference\" works, too\n"> <"\t\tCOMMIT\n"> <"\t\tfrom $from\n"> <"\t\tINPUT_END\n"> <"\t\techo done\n"> <"\t) | git -c fastimport.unpackLimit=100 fast-import --done &&\n"> <"\ttest $(find .git/objects/?? -type f | wc -l) -eq 6 &&\n"> <"\ttest $(find .git/objects/pack -type f | wc -l) -eq 2\n"> ) } ) (C {(test_done)}) ] )