diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-05-13 14:50:32 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-13 14:50:32 (GMT) |
commit | 2bfb182bc544214b3a15058b52b3a00c9811e3c2 (patch) | |
tree | 7bc80ce4ab1e3c8e6ca79d8c001384ec591a951a /builtin | |
parent | 5b51f0d38d24a21dc69a53e972497928183d399e (diff) | |
parent | d4316604f85c99a503832128a6dfb0f5ea101298 (diff) | |
download | git-2bfb182bc544214b3a15058b52b3a00c9811e3c2.zip git-2bfb182bc544214b3a15058b52b3a00c9811e3c2.tar.gz git-2bfb182bc544214b3a15058b52b3a00c9811e3c2.tar.bz2 |
Merge branch 'ew/repack-with-bitmaps-by-default'
The connectivity bitmaps are created by default in bare
repositories now; also the pathname hash-cache is created by
default to avoid making crappy deltas when repacking.
* ew/repack-with-bitmaps-by-default:
pack-objects: default to writing bitmap hash-cache
t5310: correctly remove bitmaps for jgit test
repack: enable bitmaps by default on bare repos
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/pack-objects.c | 2 | ||||
-rw-r--r-- | builtin/repack.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index d7743f1..9f424aa 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -97,7 +97,7 @@ static off_t reuse_packfile_offset; static int use_bitmap_index_default = 1; static int use_bitmap_index = -1; static int write_bitmap_index; -static uint16_t write_bitmap_options; +static uint16_t write_bitmap_options = BITMAP_OPT_HASH_CACHE; static int exclude_promisor_objects; diff --git a/builtin/repack.c b/builtin/repack.c index 67f8978..caca113 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -14,7 +14,7 @@ static int delta_base_offset = 1; static int pack_kept_objects = -1; -static int write_bitmaps; +static int write_bitmaps = -1; static int use_delta_islands; static char *packdir, *packtmp; @@ -343,6 +343,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix) (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE))) die(_("--keep-unreachable and -A are incompatible")); + if (write_bitmaps < 0) + write_bitmaps = (pack_everything & ALL_INTO_ONE) && + is_bare_repository(); if (pack_kept_objects < 0) pack_kept_objects = write_bitmaps; |