summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2023-12-11 10:07:29 +0100
committerJunio C Hamano <gitster@pobox.com>2023-12-11 07:23:15 -0800
commite32b8ece640fc700c5a74dd53e6cae8b1a893a6d (patch)
treeb4847d1138284eba0b9a20ce460c37c19994f6e6 /builtin/commit.c
parent564d0252ca632e0264ed670534a51d18a689ef5d (diff)
reftable: wrap EXPECT macros in do/while
The `EXPECT` macros used by the reftable test framework are all using a single `if` statement with the actual condition. This results in weird syntax when using them in if/else statements like the following: ``` if (foo) EXPECT(foo == 2) else EXPECT(bar == 2) ``` Note that there need not be a trailing semicolon. Furthermore, it is not immediately obvious whether the else now belongs to the `if (foo)` or whether it belongs to the expanded `if (foo == 2)` from the macro. Fix this by wrapping the macros in a do/while loop. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions