diff-parseopt: convert --ita-[in]visible-in-index

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Mar 24, 2019 at 15:19 UTC 96860e48d3b7da2f20f4b7e8668246335d0527b9
1 file changed +7 -4
diff.c
+7 -4
@@ -5352,6 +5352,12 @@ static void prep_parse_options(struct diff_options *options)
5352 N_("specify how differences in submodules are shown"),
5353 PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
5354 diff_opt_submodule),
5355 + OPT_SET_INT_F(0, "ita-invisible-in-index", &options->ita_invisible_in_index,
5356 + N_("hide 'git add -N' entries from the index"),
5357 + 1, PARSE_OPT_NONEG),
5358 + OPT_SET_INT_F(0, "ita-visible-in-index", &options->ita_invisible_in_index,
5359 + N_("treat 'git add -N' entries as real in the index"),
5360 + 0, PARSE_OPT_NONEG),
5361 { OPTION_CALLBACK, 0, "output", options, N_("<file>"),
5362 N_("Output to a specific file"),
5363 PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5401,10 +5407,7 @@ int diff_opt_parse(struct diff_options *options,
5407 if (cm & COLOR_MOVED_WS_ERROR)
5408 return -1;
5409 options->color_moved_ws_handling = cm;
5404 - } else if (!strcmp(arg, "--ita-invisible-in-index"))
5405 - options->ita_invisible_in_index = 1;
5406 - else if (!strcmp(arg, "--ita-visible-in-index"))
5407 - options->ita_invisible_in_index = 0;
5410 + }
5411
5412 /* misc options */
5413 else if (!strcmp(arg, "-z"))