Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-19 00:53:30 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-19 00:53:30 +0300
commit9b7e531f94c610439cff3c8d4556742524184463 (patch)
tree13c7e3ade31359f53e48c5353debbd4b6bea6753 /t/t5326-multi-pack-bitmaps.sh
parent18636afdce5f272d79fe6c3036e4e74f69a0845a (diff)
parenteb57277ba3dcdf97a66dcd2c471e29bf64d3279f (diff)
Merge branch 'tb/midx-no-bitmap-for-no-objects'
When there is no object to write .bitmap file for, "git multi-pack-index" triggered an error, instead of just skipping, which has been corrected. * tb/midx-no-bitmap-for-no-objects: midx: prevent writing a .bitmap without any objects
Diffstat (limited to 't/t5326-multi-pack-bitmaps.sh')
-rwxr-xr-xt/t5326-multi-pack-bitmaps.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t5326-multi-pack-bitmaps.sh b/t/t5326-multi-pack-bitmaps.sh
index 3c1ecc7e25..4fe57414c1 100755
--- a/t/t5326-multi-pack-bitmaps.sh
+++ b/t/t5326-multi-pack-bitmaps.sh
@@ -266,6 +266,28 @@ test_expect_success 'hash-cache values are propagated from pack bitmaps' '
)
'
+test_expect_success 'no .bitmap is written without any objects' '
+ rm -fr repo &&
+ git init repo &&
+ test_when_finished "rm -fr repo" &&
+ (
+ cd repo &&
+
+ empty="$(git pack-objects $objdir/pack/pack </dev/null)" &&
+ cat >packs <<-EOF &&
+ pack-$empty.idx
+ EOF
+
+ git multi-pack-index write --bitmap --stdin-packs \
+ <packs 2>err &&
+
+ grep "bitmap without any objects" err &&
+
+ test_path_is_file $midx &&
+ test_path_is_missing $midx-$(midx_checksum $objdir).bitmap
+ )
+'
+
test_expect_success 'graceful fallback when missing reverse index' '
rm -fr repo &&
git init repo &&