summaryrefslogtreecommitdiff
path: root/t/t1050-large.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-05-26 10:28:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-29 17:50:56 (GMT)
commitcf2ba13ac6a7589fde5b7e888fedb2e7299e423a (patch)
tree88d11e26c37e02f64f16f0df03e2911de625f970 /t/t1050-large.sh
parentc9018b0305a56436c85b292edbeacff04b0ebb5d (diff)
downloadgit-cf2ba13ac6a7589fde5b7e888fedb2e7299e423a.zip
git-cf2ba13ac6a7589fde5b7e888fedb2e7299e423a.tar.gz
git-cf2ba13ac6a7589fde5b7e888fedb2e7299e423a.tar.bz2
pack-objects: use streaming interface for reading large loose blobs
git usually streams large blobs directly to packs. But there are cases where git can create large loose blobs (unpack-objects or hash-object over pipe). Or they can come from other git implementations. core.bigfilethreshold can also be lowered down and introduce a new wave of large loose blobs. Use streaming interface to read/compress/write these blobs in one go. Fall back to normal way if somehow streaming interface cannot be used. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1050-large.sh')
-rwxr-xr-xt/t1050-large.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index 55ed955..313889b 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -134,6 +134,18 @@ test_expect_success 'repack' '
git repack -ad
'
+test_expect_success 'pack-objects with large loose object' '
+ SHA1=`git hash-object huge` &&
+ test_create_repo loose &&
+ echo $SHA1 | git pack-objects --stdout |
+ GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects &&
+ echo $SHA1 | GIT_DIR=loose/.git git pack-objects pack &&
+ test_create_repo packed &&
+ mv pack-* packed/.git/objects/pack &&
+ GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
+ cmp huge actual
+'
+
test_expect_success 'tar achiving' '
git archive --format=tar HEAD >/dev/null
'