summaryrefslogtreecommitdiff
path: root/builtin/multi-pack-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-11 17:21:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-11 17:21:46 (GMT)
commit9567a670d2b1f99bfd9547ed186441263b760b17 (patch)
tree0cc871f81ada13521ccc9bf5e7a1bf1c4bf8afd3 /builtin/multi-pack-index.c
parent106298f7f9cca4158a980de149ef217751e1f943 (diff)
parent54156af0d66b64cfa290ffce302af05d256d9b9c (diff)
downloadgit-9567a670d2b1f99bfd9547ed186441263b760b17.zip
git-9567a670d2b1f99bfd9547ed186441263b760b17.tar.gz
git-9567a670d2b1f99bfd9547ed186441263b760b17.tar.bz2
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 'builtin/multi-pack-index.c')
-rw-r--r--builtin/multi-pack-index.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 0fb2439..6426bbd 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -60,6 +60,23 @@ static struct option *add_common_options(struct option *prev)
return parse_options_concat(common_opts, prev);
}
+static int git_multi_pack_index_write_config(const char *var, const char *value,
+ void *cb)
+{
+ if (!strcmp(var, "pack.writebitmaphashcache")) {
+ if (git_config_bool(var, value))
+ opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
+ else
+ opts.flags &= ~MIDX_WRITE_BITMAP_HASH_CACHE;
+ }
+
+ /*
+ * We should never make a fall-back call to 'git_default_config', since
+ * this was already called in 'cmd_multi_pack_index()'.
+ */
+ return 0;
+}
+
static int cmd_multi_pack_index_write(int argc, const char **argv)
{
struct option *options;
@@ -74,6 +91,10 @@ static int cmd_multi_pack_index_write(int argc, const char **argv)
OPT_END(),
};
+ opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
+
+ git_config(git_multi_pack_index_write_config, NULL);
+
options = add_common_options(builtin_multi_pack_index_write_options);
trace2_cmd_mode(argv[0]);