fast-import: implement unpack limit
[git/gitweb.git] / t / t9302-fast-import-unpack-limit.sh
blob0f686d2199acb88cc743b6720e815984dfe7fce1
1 #!/bin/sh
2 test_description='test git fast-import unpack limit'
3 . ./test-lib.sh
5 test_expect_success 'create loose objects on import' '
6 test_tick &&
7 cat >input <<-INPUT_END &&
8 commit refs/heads/master
9 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
10 data <<COMMIT
11 initial
12 COMMIT
14 done
15 INPUT_END
17 git -c fastimport.unpackLimit=2 fast-import --done <input &&
18 git fsck --no-progress &&
19 test $(find .git/objects/?? -type f | wc -l) -eq 2 &&
20 test $(find .git/objects/pack -type f | wc -l) -eq 0
23 test_expect_success 'bigger packs are preserved' '
24 test_tick &&
25 cat >input <<-INPUT_END &&
26 commit refs/heads/master
27 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
28 data <<COMMIT
29 incremental should create a pack
30 COMMIT
31 from refs/heads/master^0
33 commit refs/heads/branch
34 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
35 data <<COMMIT
36 branch
37 COMMIT
39 done
40 INPUT_END
42 git -c fastimport.unpackLimit=2 fast-import --done <input &&
43 git fsck --no-progress &&
44 test $(find .git/objects/?? -type f | wc -l) -eq 2 &&
45 test $(find .git/objects/pack -type f | wc -l) -eq 2
48 test_done