summaryrefslogtreecommitdiff
path: root/builtin/repack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-25 19:23:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-25 19:23:19 (GMT)
commit25f3119000ab8b98cb54e9925f4e307a5dab2f87 (patch)
tree6e655c84ad726de98d3d6b929e1171727d41246b /builtin/repack.c
parentb30adaac5238a611f12c407912b75112ad4cf186 (diff)
parent2d0174e38eed8143b1df0584a6c038fdaee5b89b (diff)
downloadgit-25f3119000ab8b98cb54e9925f4e307a5dab2f87.zip
git-25f3119000ab8b98cb54e9925f4e307a5dab2f87.tar.gz
git-25f3119000ab8b98cb54e9925f4e307a5dab2f87.tar.bz2
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/repack.c')
-rw-r--r--builtin/repack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 36c1cf9..ff2216a 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);