aboutsummaryrefslogtreecommitdiffstats
path: root/diff.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-11-12 14:02:49 -0800
committerJunio C Hamano <gitster@pobox.com>2025-11-12 14:04:04 -0800
commitfc7abcd9d5460b381701ef43b7f6dafa73962950 (patch)
tree35874becfbcfc3da357bc3e32b98e27298361778 /diff.h
parentf83d1afafb8b772397aa3854184c42f7810fa0df (diff)
downloadgit-fc7abcd9d5460b381701ef43b7f6dafa73962950.tar.gz
diff: correct suppress_blank_empty hack
The suppress-blank-empty feature abused the CONTEXT_INCOMPLETE symbol that was meant to be used only for "\ No newline at the end of file" code path. The intent of the feature was to turn a context line we receive from xdiff machinery (which always uses ' ' for context lines, even an empty one) and spit it out as a truly empty line. Perform such a conversion very locally at where a line from xdiff that begins with ' ' is handled for output; there are many checks before the control reaches such place that checks the first letter of the diff output line to see if it is a context line, and having to check for '\n' and treat it as a special case is error prone. In order to catch similar hacks in the future, make sure the code path that is meant for "\ No newline" case checks the first byte is indeed a backslash. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.h')
0 files changed, 0 insertions, 0 deletions