]> granicus.if.org Git - git/commitdiff
pack-objects: introduce pack.allowPackReuse
authorJeff King <peff@peff.net>
Fri, 13 Sep 2019 13:02:24 +0000 (15:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Sep 2019 21:40:34 +0000 (14:40 -0700)
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>
builtin/pack-objects.c

index c11b2ea8d43a7110eca6fa149e48c6ae2c2d9f9d..1664969c9782221099970e82d62f9da9ee765001 100644 (file)
@@ -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,
@@ -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)
@@ -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,