summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-11 10:21:46 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-11 10:21:46 -0700
commit9567a670d2b1f99bfd9547ed186441263b760b17 (patch)
tree0cc871f81ada13521ccc9bf5e7a1bf1c4bf8afd3 /midx.c
parent106298f7f9cca4158a980de149ef217751e1f943 (diff)
parent54156af0d66b64cfa290ffce302af05d256d9b9c (diff)
downloadgit-9567a670d2b1f99bfd9547ed186441263b760b17.tar.gz
Merge branch 'tb/midx-write-propagate-namehash'
"git multi-pack-index write --bitmap" learns to propagate the hashcache from original bitmap to resulting bitmap. * tb/midx-write-propagate-namehash: t5326: test propagating hashcache values p5326: generate pack bitmaps before writing the MIDX bitmap p5326: don't set core.multiPackIndex unnecessarily p5326: create missing 'perf-tag' tag midx.c: respect 'pack.writeBitmapHashcache' when writing bitmaps pack-bitmap.c: propagate namehash values from existing bitmaps t/helper/test-bitmap.c: add 'dump-hashes' mode
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/midx.c b/midx.c
index f96fb2efee..4a01583fe8 100644
--- a/midx.c
+++ b/midx.c
@@ -993,9 +993,13 @@ static int write_midx_bitmap(char *midx_name, unsigned char *midx_hash,
struct pack_idx_entry **index;
struct commit **commits = NULL;
uint32_t i, commits_nr;
+ uint16_t options = 0;
char *bitmap_name = xstrfmt("%s-%s.bitmap", midx_name, hash_to_hex(midx_hash));
int ret;
+ if (flags & MIDX_WRITE_BITMAP_HASH_CACHE)
+ options |= BITMAP_OPT_HASH_CACHE;
+
prepare_midx_packing_data(&pdata, ctx);
commits = find_commits_for_midx_bitmap(&commits_nr, ctx);
@@ -1034,7 +1038,7 @@ static int write_midx_bitmap(char *midx_name, unsigned char *midx_hash,
goto cleanup;
bitmap_writer_set_checksum(midx_hash);
- bitmap_writer_finish(index, pdata.nr_objects, bitmap_name, 0);
+ bitmap_writer_finish(index, pdata.nr_objects, bitmap_name, options);
cleanup:
free(index);