diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-05-26 17:28:01 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-29 10:50:56 -0700 |
commit | cf2ba13ac6a7589fde5b7e888fedb2e7299e423a (patch) | |
tree | 88d11e26c37e02f64f16f0df03e2911de625f970 /t/t1050-large.sh | |
parent | c9018b0305a56436c85b292edbeacff04b0ebb5d (diff) | |
download | git-cf2ba13ac6a7589fde5b7e888fedb2e7299e423a.tar.gz |
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-x | t/t1050-large.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t1050-large.sh b/t/t1050-large.sh index 55ed955cef..313889b5b4 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 ' |