]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pretty: avoid double negative in format_commit_item()
authorRené Scharfe <l.s.r@web.de>
Fri, 7 Jul 2023 18:46:26 +0000 (20:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jul 2023 19:05:42 +0000 (12:05 -0700)
Test for equality with no_flush, which has enough negation already.  Get
rid of the unnecessary parentheses while at it.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty.c

index 4c08f9856be0301e3797d8072ed2f628f3287346..a6c617b4753b89e6f272738d1f4dd4fbe4d3344f 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1852,10 +1852,10 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
        }
 
        orig_len = sb->len;
-       if ((context)->flush_type != no_flush)
-               consumed = format_and_pad_commit(sb, placeholder, context);
-       else
+       if (context->flush_type == no_flush)
                consumed = format_commit_one(sb, placeholder, context);
+       else
+               consumed = format_and_pad_commit(sb, placeholder, context);
        if (magic == NO_MAGIC)
                return consumed;