Merge branch 'jk/pack-objects-no-bitmap-when-splitting'
authorJunio C Hamano <gitster@pobox.com>
Fri, 24 Oct 2014 21:56:10 +0000 (14:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Oct 2014 21:56:10 +0000 (14:56 -0700)
Splitting pack-objects output into multiple packs is incompatible
with the use of reachability bitmap.

* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs

builtin/pack-objects.c
t/t5310-pack-bitmaps.sh
index d39193453a6bf868f8b62dac18201b0b4b7bccbd..a4022a78d0a8158dfefaa71309f9386bc82f5f8c 100644 (file)
@@ -811,6 +811,7 @@ static void write_pack_file(void)
                        fixup_pack_header_footer(fd, sha1, pack_tmp_name,
                                                 nr_written, sha1, offset);
                        close(fd);
+                       write_bitmap_index = 0;
                }
 
                if (!pack_to_stdout) {
index 0580258c91a07aabe2773cce04df47d3c183b425..6003490192880802d866ec3788facaf4dcf17147 100755 (executable)
@@ -170,4 +170,13 @@ test_expect_success JGIT 'jgit can read our bitmaps' '
        )
 '
 
+test_expect_success 'splitting packs does not generate bogus bitmaps' '
+       test-genrandom foo $((1024 * 1024)) >rand &&
+       git add rand &&
+       git commit -m "commit with big file" &&
+       git -c pack.packSizeLimit=500k repack -adb &&
+       git init --bare no-bitmaps.git &&
+       git -C no-bitmaps.git fetch .. HEAD
+'
+
 test_done