summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-24 08:20:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-24 13:21:23 (GMT)
commitbb9872904e032f28e4ac9d2438c4daba9eae9d05 (patch)
treef008a07a33f556c159b8fe6f3328d2b3d0d731b7 /diff.c
parent8ce2020ff079955b4a068d96a93e00a65f570355 (diff)
downloadgit-bb9872904e032f28e4ac9d2438c4daba9eae9d05.zip
git-bb9872904e032f28e4ac9d2438c4daba9eae9d05.tar.gz
git-bb9872904e032f28e4ac9d2438c4daba9eae9d05.tar.bz2
diff.c: allow --no-color-moved-ws
This option is added in commit b73bcbac4a (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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 1a24bbf..8b770cd 100644
--- a/diff.c
+++ b/diff.c
@@ -4868,7 +4868,11 @@ static int diff_opt_color_moved_ws(const struct option *opt,
struct diff_options *options = opt->value;
unsigned cm;
- BUG_ON_OPT_NEG(unset);
+ if (unset) {
+ options->color_moved_ws_handling = 0;
+ return 0;
+ }
+
cm = parse_color_moved_ws(arg);
if (cm & COLOR_MOVED_WS_ERROR)
return error(_("invalid mode '%s' in --color-moved-ws"), arg);
@@ -5379,7 +5383,7 @@ static void prep_parse_options(struct diff_options *options)
PARSE_OPT_OPTARG, diff_opt_color_moved),
OPT_CALLBACK_F(0, "color-moved-ws", options, N_("<mode>"),
N_("how white spaces are ignored in --color-moved"),
- PARSE_OPT_NONEG, diff_opt_color_moved_ws),
+ 0, diff_opt_color_moved_ws),
OPT_GROUP(N_("Diff other options")),
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),