diff-parseopt: convert --[no-]indent-heuristic

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 06f77518db2b6a88ffa27c7d4516840b78ee0d3a
1 file changed +4 -5
diff.c
+4 -5
@@ -5124,6 +5124,9 @@ static void prep_parse_options(struct diff_options *options)
5124 OPT_BIT_F(0, "ignore-blank-lines", &options->xdl_opts,
5125 N_("ignore changes whose lines are all blank"),
5126 XDF_IGNORE_BLANK_LINES, PARSE_OPT_NONEG),
5127 + OPT_BIT(0, "indent-heuristic", &options->xdl_opts,
5128 + N_("heuristic to shift diff hunk boundaries for easy reading"),
5129 + XDF_INDENT_HEURISTIC),
5130
5131 OPT_GROUP(N_("Diff other options")),
5132 OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),
@@ -5162,11 +5165,7 @@ int diff_opt_parse(struct diff_options *options,
5165 return ac;
5166
5167 /* xdiff options */
5165 - if (!strcmp(arg, "--indent-heuristic"))
5166 - DIFF_XDL_SET(options, INDENT_HEURISTIC);
5167 - else if (!strcmp(arg, "--no-indent-heuristic"))
5168 - DIFF_XDL_CLR(options, INDENT_HEURISTIC);
5169 - else if (!strcmp(arg, "--patience")) {
5168 + if (!strcmp(arg, "--patience")) {
5169 int i;
5170 options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
5171 /*