summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-11-05 06:39:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-06 03:55:35 (GMT)
commitf53c163bcd7ae9bf83aa87be81dc6a4661924f3e (patch)
tree360a6c3787a6a2ba869bf5538887d8b68ee94422
parentccf659e87c8fdb4edb5d2653c53bc9062c8eee76 (diff)
downloadgit-f53c163bcd7ae9bf83aa87be81dc6a4661924f3e.zip
git-f53c163bcd7ae9bf83aa87be81dc6a4661924f3e.tar.gz
git-f53c163bcd7ae9bf83aa87be81dc6a4661924f3e.tar.bz2
pack-objects: mark index-version option as NONEG
Running "git pack-objects --no-index-version" will segfault, since the callback is not prepared to handle the "unset" flag. In theory this might be used to counteract an earlier "--index-version", or override a pack.indexversion config setting. But the semantics aren't immediately obvious, and it's unlikely anybody wants this. Let's just disable the broken option for now. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index e50c6cd..4eac2f9 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3252,7 +3252,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
N_("similar to --all-progress when progress meter is shown")),
{ OPTION_CALLBACK, 0, "index-version", NULL, N_("<version>[,<offset>]"),
N_("write the pack index file in the specified idx format version"),
- 0, option_parse_index_version },
+ PARSE_OPT_NONEG, option_parse_index_version },
OPT_MAGNITUDE(0, "max-pack-size", &pack_size_limit,
N_("maximum size of each output pack file")),
OPT_BOOL(0, "local", &local,