summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-11-02 03:26:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-02 08:32:02 (GMT)
commit4d00bda2aa9dd8cd6ec4015832b80eb1273d46d7 (patch)
treed51a3b7d5534e1b2aeaba0305d4de493b04d6ef8 /builtin-pack-objects.c
parent3e4bb087a18435b12eb82116e93af2887578e816 (diff)
downloadgit-4d00bda2aa9dd8cd6ec4015832b80eb1273d46d7.zip
git-4d00bda2aa9dd8cd6ec4015832b80eb1273d46d7.tar.gz
git-4d00bda2aa9dd8cd6ec4015832b80eb1273d46d7.tar.bz2
make the pack index version configurable
It is a good idea to use pack index version 2 all the time since it has proper protection against propagation of certain pack corruptions when repacking which is not possible with index version 1, as demonstrated in test t5302. Hence this config option. The default is still pack index version 1. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 0be539e..f4b90c1 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1773,6 +1773,12 @@ static int git_pack_config(const char *k, const char *v)
#endif
return 0;
}
+ if (!strcmp(k, "pack.indexversion")) {
+ pack_idx_default_version = git_config_int(k, v);
+ if (pack_idx_default_version > 2)
+ die("bad pack.indexversion=%d", pack_idx_default_version);
+ return 0;
+ }
return git_default_config(k, v);
}