summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-12 22:21:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-12 22:21:04 (GMT)
commit3c12d0b885918fb5c6d5cb2be538639a52e1ef53 (patch)
tree89560c36c500d291b9a61ba9c1dbce13593b7269 /builtin/pack-objects.c
parent2c873f97913994f8478a9078ff8b62e17378a0ed (diff)
parent6885cd7dc573b1750b8d895820b8b2f56285f070 (diff)
downloadgit-3c12d0b885918fb5c6d5cb2be538639a52e1ef53.zip
git-3c12d0b885918fb5c6d5cb2be538639a52e1ef53.tar.gz
git-3c12d0b885918fb5c6d5cb2be538639a52e1ef53.tar.bz2
Merge branch 'tb/pack-revindex-on-disk'
Introduce an on-disk file to record revindex for packdata, which traditionally was always created on the fly and only in-core. * tb/pack-revindex-on-disk: t5325: check both on-disk and in-memory reverse index pack-revindex: ensure that on-disk reverse indexes are given precedence t: support GIT_TEST_WRITE_REV_INDEX t: prepare for GIT_TEST_WRITE_REV_INDEX Documentation/config/pack.txt: advertise 'pack.writeReverseIndex' builtin/pack-objects.c: respect 'pack.writeReverseIndex' builtin/index-pack.c: write reverse indexes builtin/index-pack.c: allow stripping arbitrary extensions pack-write.c: prepare to write 'pack-*.rev' files packfile: prepare for the existence of '*.rev' files
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 13cde58..6d62aaf 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2953,6 +2953,13 @@ static int git_pack_config(const char *k, const char *v, void *cb)
pack_idx_opts.version);
return 0;
}
+ if (!strcmp(k, "pack.writereverseindex")) {
+ if (git_config_bool(k, v))
+ pack_idx_opts.flags |= WRITE_REV;
+ else
+ pack_idx_opts.flags &= ~WRITE_REV;
+ return 0;
+ }
if (!strcmp(k, "uploadpack.blobpackfileuri")) {
struct configured_exclusion *ex = xmalloc(sizeof(*ex));
const char *oid_end, *pack_end;
@@ -3592,6 +3599,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
reset_pack_idx_option(&pack_idx_opts);
git_config(git_pack_config, NULL);
+ if (git_env_bool(GIT_TEST_WRITE_REV_INDEX, 0))
+ pack_idx_opts.flags |= WRITE_REV;
progress = isatty(2);
argc = parse_options(argc, argv, prefix, pack_objects_options,