diff-parseopt: convert --full-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 5, 2019 at 19:30 UTC 4fe016721500c1874fffc25a86e36bd3541c6a38
1 file changed +3 -3
diff.c
+3 -3
@@ -5131,6 +5131,8 @@ static void prep_parse_options(struct diff_options *options)
5131 OPT_CALLBACK_F(0, "binary", options, NULL,
5132 N_("output a binary diff that can be applied"),
5133 PARSE_OPT_NONEG | PARSE_OPT_NOARG, diff_opt_binary),
5134 + OPT_BOOL(0, "full-index", &options->flags.full_index,
5135 + N_("show full pre- and post-image object names on the \"index\" lines")),
5136 OPT_CALLBACK_F(0, "output-indicator-new",
5137 &options->output_indicators[OUTPUT_INDICATOR_NEW],
5138 N_("<char>"),
@@ -5244,9 +5246,7 @@ int diff_opt_parse(struct diff_options *options,
5246 return ac;
5247
5248 /* flags options */
5247 - if (!strcmp(arg, "--full-index"))
5248 - options->flags.full_index = 1;
5249 - else if (!strcmp(arg, "-a") || !strcmp(arg, "--text"))
5249 + if (!strcmp(arg, "-a") || !strcmp(arg, "--text"))
5250 options->flags.text = 1;
5251 else if (!strcmp(arg, "-R"))
5252 options->flags.reverse_diff = 1;