t / perf / lib-pack.shon commit Merge branch 'ao/config-api-doc' (d9a0ddc)
   1# Helpers for dealing with large numbers of packs.
   2
   3# create $1 nonsense packs, each with a single blob
   4create_packs () {
   5        perl -le '
   6                my ($n) = @ARGV;
   7                for (1..$n) {
   8                        print "blob";
   9                        print "data <<EOF";
  10                        print "$_";
  11                        print "EOF";
  12                        print "checkpoint"
  13                }
  14        ' "$@" |
  15        git fast-import
  16}
  17
  18# create a large number of packs, disabling any gc which might
  19# cause us to repack them
  20setup_many_packs () {
  21        git config gc.auto 0 &&
  22        git config gc.autopacklimit 0 &&
  23        git config fastimport.unpacklimit 0 &&
  24        create_packs 500
  25}