blob: d3865db286fc644e3a6dc20a2e8932695b35df2a [file] [log] [blame]
Jeff Kingaa338d32017-11-20 15:26:43 -05001# 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";
Jeff King0a11e402017-11-20 15:27:19 -050012 print "checkpoint"
Jeff Kingaa338d32017-11-20 15:26:43 -050013 }
14 ' "$@" |
Jeff King0a11e402017-11-20 15:27:19 -050015 git fast-import
Jeff Kingaa338d32017-11-20 15:26:43 -050016}
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 &&
Jeff King0a11e402017-11-20 15:27:19 -050023 git config fastimport.unpacklimit 0 &&
Jeff Kingaa338d32017-11-20 15:26:43 -050024 create_packs 500
25}