diff options
-rw-r--r-- | Documentation/config.txt | 8 | ||||
-rw-r--r-- | builtin/repack.c | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 499a3c4360..ed98e91ed8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2128,6 +2128,14 @@ repack.usedeltabaseoffset:: "false" and repack. Access from old Git versions over the native protocol are unaffected by this option. +repack.honorPackKeep:: + If set to false, include objects in `.keep` files when repacking + via `git repack`. Note that we still do not delete `.keep` packs + after `pack-objects` finishes. This means that we may duplicate + objects, but this makes the option safe to use when there are + concurrent pushes or fetches. This option is generally only + useful if you have set `pack.writeBitmaps`. Defaults to true. + rerere.autoupdate:: When set to true, `git-rerere` updates the index with the resulting contents after it cleanly resolves conflicts using diff --git a/builtin/repack.c b/builtin/repack.c index 239f278fac..b4439edf26 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -9,6 +9,7 @@ #include "argv-array.h" static int delta_base_offset = 1; +static int honor_pack_keep = 1; static char *packdir, *packtmp; static const char *const git_repack_usage[] = { @@ -22,6 +23,10 @@ static int repack_config(const char *var, const char *value, void *cb) delta_base_offset = git_config_bool(var, value); return 0; } + if (!strcmp(var, "repack.honorpackkeep")) { + honor_pack_keep = git_config_bool(var, value); + return 0; + } return git_default_config(var, value, cb); } @@ -190,10 +195,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix) argv_array_push(&cmd_args, "pack-objects"); argv_array_push(&cmd_args, "--keep-true-parents"); - argv_array_push(&cmd_args, "--honor-pack-keep"); argv_array_push(&cmd_args, "--non-empty"); argv_array_push(&cmd_args, "--all"); argv_array_push(&cmd_args, "--reflog"); + if (honor_pack_keep) + argv_array_push(&cmd_args, "--honor-pack-keep"); if (window) argv_array_pushf(&cmd_args, "--window=%u", window); if (window_memory) |