Merge branch 'nd/stream-pack-objects'
authorJunio C Hamano <gitster@pobox.com>
Thu, 28 Jun 2012 22:19:51 +0000 (15:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Jun 2012 22:19:51 +0000 (15:19 -0700)
"pack-objects" learned to read large loose blobs using the streaming API,
without the need to hold everything in core at once.

1  2 
t/t1050-large.sh
diff --combined t/t1050-large.sh
index 3f806889a9e3bd4118e279ebafb84154f24c2853,313889b5b4d9b52dc68d64cde3587d41f57c1340..fd105280092b7f655f5c48f09b2e8f5e0ee6d351
@@@ -130,15 -130,22 +130,27 @@@ test_expect_success 'git-show a large f
  
  '
  
 +test_expect_success 'index-pack' '
 +      git clone file://"`pwd`"/.git foo &&
 +      GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack
 +'
 +
  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
  '