Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2010-02-04 06:48:28 +0300
committerJunio C Hamano <gitster@pobox.com>2010-02-04 07:39:56 +0300
commit07cf0f2407709e3764ea989696b513ec32613504 (patch)
tree3eab6f3be18ea1e04abbf8c34e706f021b78c28f /t/t5300-pack-object.sh
parenta2430dde8ceaaaabf05937438249397b883ca77a (diff)
make --max-pack-size argument to 'git pack-object' count in bytes
The value passed to --max-pack-size used to count in MiB which was inconsistent with the corresponding configuration variable as well as other command arguments which are defined to count in bytes with an optional unit suffix. This brings --max-pack-size in line with the rest of Git. Also, in order not to cause havoc with people used to the previous megabyte scale, and because this is a sane thing to do anyway, a minimum size of 1 MiB is enforced to avoid an explosion of pack files. Adjust and extend test suite accordingly. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5300-pack-object.sh')
-rwxr-xr-xt/t5300-pack-object.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 7c6231c66a..1058d981dc 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -16,7 +16,9 @@ test_expect_success \
perl -e "print \"a\" x 4096;" > a &&
perl -e "print \"b\" x 4096;" > b &&
perl -e "print \"c\" x 4096;" > c &&
- git update-index --add a b c &&
+ test-genrandom "seed a" 2097152 > a_big &&
+ test-genrandom "seed b" 2097152 > b_big &&
+ git update-index --add a a_big b b_big c &&
cat c >d && echo foo >>d && git update-index --add d &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` && {
@@ -375,19 +377,19 @@ test_expect_success 'index-pack with --strict' '
'
test_expect_success 'honor pack.packSizeLimit' '
- git config pack.packSizeLimit 200 &&
+ git config pack.packSizeLimit 3m &&
packname_10=$(git pack-objects test-10 <obj-list) &&
- test 3 = $(ls test-10-*.pack | wc -l)
+ test 2 = $(ls test-10-*.pack | wc -l)
'
test_expect_success 'verify resulting packs' '
git verify-pack test-10-*.pack
'
-test_expect_success 'tolerate absurdly small packsizelimit' '
- git config pack.packSizeLimit 2 &&
+test_expect_success 'tolerate packsizelimit smaller than biggest object' '
+ git config pack.packSizeLimit 1 &&
packname_11=$(git pack-objects test-11 <obj-list) &&
- test $(wc -l <obj-list) = $(ls test-11-*.pack | wc -l)
+ test 3 = $(ls test-11-*.pack | wc -l)
'
test_expect_success 'verify resulting packs' '