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>
Jeff King committed
Nov 5, 2018 at 01:39 UTC
f53c163bcd7ae9bf83aa87be81dc6a4661924f3e
1 file changed
+1
-1
builtin/pack-objects.c
+1
-1
@@ -3252,7 +3252,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
3252
N_("similar to --all-progress when progress meter is shown")),
3253
{ OPTION_CALLBACK, 0, "index-version", NULL, N_("<version>[,<offset>]"),
3254
N_("write the pack index file in the specified idx format version"),
3255
- 0, option_parse_index_version },
3255
+ PARSE_OPT_NONEG, option_parse_index_version },
3256
OPT_MAGNITUDE(0, "max-pack-size", &pack_size_limit,
3257
N_("maximum size of each output pack file")),
3258
OPT_BOOL(0, "local", &local,