From: Jeff King <p...@peff.net>

Let's make it possible to configure if we want pack reuse or not.

Signed-off-by: Jeff King <p...@peff.net>
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org>
---
 builtin/pack-objects.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index c11b2ea8d4..1664969c97 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -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,
-- 
2.23.0.46.gd213b4aca1.dirty

Reply via email to