Skip to content

Commit bb98729

Browse files
pcloudsgitster
authored andcommitted
diff.c: allow --no-color-moved-ws
This option is added in commit b73bcba (diff: allow --no-color-moved-ws - 2018-11-23) in pw/diff-color-moved-ws-fix. To ease merge conflict resolution, re-implement the option handling here so that the conflict could be resolved by taking this side of change. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8ce2020 commit bb98729

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

diff.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4868,7 +4868,11 @@ static int diff_opt_color_moved_ws(const struct option *opt,
48684868
struct diff_options *options = opt->value;
48694869
unsigned cm;
48704870

4871-
BUG_ON_OPT_NEG(unset);
4871+
if (unset) {
4872+
options->color_moved_ws_handling = 0;
4873+
return 0;
4874+
}
4875+
48724876
cm = parse_color_moved_ws(arg);
48734877
if (cm & COLOR_MOVED_WS_ERROR)
48744878
return error(_("invalid mode '%s' in --color-moved-ws"), arg);
@@ -5379,7 +5383,7 @@ static void prep_parse_options(struct diff_options *options)
53795383
PARSE_OPT_OPTARG, diff_opt_color_moved),
53805384
OPT_CALLBACK_F(0, "color-moved-ws", options, N_("<mode>"),
53815385
N_("how white spaces are ignored in --color-moved"),
5382-
PARSE_OPT_NONEG, diff_opt_color_moved_ws),
5386+
0, diff_opt_color_moved_ws),
53835387

53845388
OPT_GROUP(N_("Diff other options")),
53855389
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),

0 commit comments

Comments
 (0)