]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff: emit_line_ws_markup() if/else style fix
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Nov 2025 21:30:42 +0000 (13:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Nov 2025 21:37:18 +0000 (13:37 -0800)
Apply the simple rule: if you need {} in one arm of the if/else
if/else... cascade, have {} in all of them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c

diff --git a/diff.c b/diff.c
index 74261b332af16cff62f0c7ebf813b4fd6f4086d0..9a24a0791ceacad8719071d079b78ef5c142a071 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1327,14 +1327,14 @@ static void emit_line_ws_markup(struct diff_options *o,
                        ws = NULL;
        }
 
-       if (!ws && !set_sign)
+       if (!ws && !set_sign) {
                emit_line_0(o, set, NULL, 0, reset, sign, line, len);
-       else if (!ws) {
+       else if (!ws) {
                emit_line_0(o, set_sign, set, !!set_sign, reset, sign, line, len);
-       } else if (blank_at_eof)
+       } else if (blank_at_eof) {
                /* Blank line at EOF - paint '+' as well */
                emit_line_0(o, ws, NULL, 0, reset, sign, line, len);
-       else {
+       else {
                /* Emit just the prefix, then the rest. */
                emit_line_0(o, set_sign ? set_sign : set, NULL, !!set_sign, reset,
                            sign, "", 0);