Skip to content

Commit

Permalink
pack-objects: introduce pack.allowPackReuse
Browse files Browse the repository at this point in the history
Let's make it possible to configure if we want pack reuse or not.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
peff authored and gitster committed Sep 13, 2019
1 parent 2ea3921 commit d35b73c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion builtin/pack-objects.c
Expand Up @@ -96,6 +96,7 @@ static off_t reuse_packfile_offset;

static int use_bitmap_index_default = 1;
static int use_bitmap_index = -1;
static int allow_pack_reuse = 1;
static enum {
WRITE_BITMAP_FALSE = 0,
WRITE_BITMAP_QUIET,
Expand Down Expand Up @@ -2719,6 +2720,10 @@ static int git_pack_config(const char *k, const char *v, void *cb)
sparse = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "pack.allowpackreuse")) {
allow_pack_reuse = git_config_bool(k, v);
return 0;
}
if (!strcmp(k, "pack.threads")) {
delta_search_threads = git_config_int(k, v);
if (delta_search_threads < 0)
Expand Down Expand Up @@ -3063,7 +3068,8 @@ static int get_object_list_from_bitmap(struct rev_info *revs)
if (!(bitmap_git = prepare_bitmap_walk(revs)))
return -1;

if (pack_options_allow_reuse() &&
if (allow_pack_reuse &&
pack_options_allow_reuse() &&
!reuse_partial_packfile_from_bitmap(
bitmap_git,
&reuse_packfile,
Expand Down

0 comments on commit d35b73c

Please sign in to comment.