Skip to content

Commit 0b91faa

Browse files
dschogitster
authored andcommitted
range-diff --dual-color: skip white-space warnings
When displaying a diff of diffs, it is possible that there is an outer `+` before a context line. That happens when the context changed between old and new commit. When that context line starts with a tab (after the space that marks it as context line), our diff machinery spits out a white-space error (space before tab), but in this case, that is incorrect. Rather than adding a specific whitespace flag that specifically ignores the first space in the output (and might miss other problems with the white-space warnings), let's just skip handling white-space errors in dual color mode to begin with. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 31cf61a commit 0b91faa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
12991299
set = diff_get_color_opt(o, DIFF_FRAGINFO);
13001300
else if (c != '+')
13011301
set = diff_get_color_opt(o, DIFF_CONTEXT);
1302+
flags &= ~DIFF_SYMBOL_CONTENT_WS_MASK;
13021303
}
13031304
emit_line_ws_markup(o, set, reset, line, len, set_sign, '+',
13041305
flags & DIFF_SYMBOL_CONTENT_WS_MASK,

0 commit comments

Comments
 (0)