diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 12:23:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 12:23:19 -0700 |
commit | 25f3119000ab8b98cb54e9925f4e307a5dab2f87 (patch) | |
tree | 6e655c84ad726de98d3d6b929e1171727d41246b /builtin | |
parent | b30adaac5238a611f12c407912b75112ad4cf186 (diff) | |
parent | 2d0174e38eed8143b1df0584a6c038fdaee5b89b (diff) | |
download | git-25f3119000ab8b98cb54e9925f4e307a5dab2f87.tar.gz |
Merge branch 'jk/repack-pack-writebitmaps-config'
* jk/repack-pack-writebitmaps-config:
t7700: drop explicit --no-pack-kept-objects from .keep test
repack: introduce repack.writeBitmaps config option
repack: simplify handling of --write-bitmap-index
pack-objects: stop respecting pack.writebitmaps
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/pack-objects.c | 4 | ||||
-rw-r--r-- | builtin/repack.c | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index de36c60ca1..238b5021eb 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2214,10 +2214,6 @@ static int git_pack_config(const char *k, const char *v, void *cb) cache_max_small_delta_size = git_config_int(k, v); return 0; } - if (!strcmp(k, "pack.writebitmaps")) { - write_bitmap_index = git_config_bool(k, v); - return 0; - } if (!strcmp(k, "pack.writebitmaphashcache")) { if (git_config_bool(k, v)) write_bitmap_options |= BITMAP_OPT_HASH_CACHE; diff --git a/builtin/repack.c b/builtin/repack.c index 36c1cf9c25..ff2216a7aa 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -10,7 +10,7 @@ static int delta_base_offset = 1; static int pack_kept_objects = -1; -static int write_bitmaps = -1; +static int write_bitmaps; static char *packdir, *packtmp; static const char *const git_repack_usage[] = { @@ -28,7 +28,8 @@ static int repack_config(const char *var, const char *value, void *cb) pack_kept_objects = git_config_bool(var, value); return 0; } - if (!strcmp(var, "pack.writebitmaps")) { + if (!strcmp(var, "repack.writebitmaps") || + !strcmp(var, "pack.writebitmaps")) { write_bitmaps = git_config_bool(var, value); return 0; } @@ -195,7 +196,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) git_repack_usage, 0); if (pack_kept_objects < 0) - pack_kept_objects = write_bitmaps > 0; + pack_kept_objects = write_bitmaps; packdir = mkpathdup("%s/pack", get_object_directory()); packtmp = mkpathdup("%s/.tmp-%d-pack", packdir, (int)getpid()); @@ -221,9 +222,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix) argv_array_pushf(&cmd_args, "--no-reuse-delta"); if (no_reuse_object) argv_array_pushf(&cmd_args, "--no-reuse-object"); - if (write_bitmaps >= 0) - argv_array_pushf(&cmd_args, "--%swrite-bitmap-index", - write_bitmaps ? "" : "no-"); + if (write_bitmaps) + argv_array_push(&cmd_args, "--write-bitmap-index"); if (pack_everything & ALL_INTO_ONE) { get_non_kept_pack_filenames(&existing_packs); |