summaryrefslogtreecommitdiff
path: root/t/t5310-pack-bitmaps.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-10-17 01:11:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-19 22:08:38 (GMT)
commit21134714787a02a37da15424d72c0119b2b8ed71 (patch)
treeae02ffed1ca43594b4dcc4a66ddff7f3f24146f3 /t/t5310-pack-bitmaps.sh
parent76f8611a5fb7e81c1bada0fb190d573a66fc03f6 (diff)
downloadgit-21134714787a02a37da15424d72c0119b2b8ed71.zip
git-21134714787a02a37da15424d72c0119b2b8ed71.tar.gz
git-21134714787a02a37da15424d72c0119b2b8ed71.tar.bz2
pack-objects: turn off bitmaps when we split packs
If a pack.packSizeLimit is set, we may split the pack data across multiple packfiles. This means we cannot generate .bitmap files, as they require that all of the reachable objects are in the same pack. We check that condition when we are generating the list of objects to pack (and disable bitmaps if we are not packing everything), but we forgot to update it when we notice that we needed to split (which doesn't happen until the actual write phase). The resulting bitmaps are quite bogus (they mention entries that do not exist in the pack!) and can cause a fetch or push to send insufficient objects. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5310-pack-bitmaps.sh')
-rwxr-xr-xt/t5310-pack-bitmaps.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index f4f02ba..2366fcf 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -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