Subject: [PATCH v3 2/8] git: make the two loops look more symmetric

From: [email-masked]
Date: Mon, 8 Sep 2025 17:36:13 +0200

From: Kristoffer Haugsbakk <[email-masked]>

Rewrite the original conditional here to match the new sibling loop
in structure.

Signed-off-by: Kristoffer Haugsbakk <[email-masked]>
---

Notes (series):
    v3 (new):
    
    This is just a refactor commit to avoid having to add a “while at it”
    for such small tweaks for the new context.

 git.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/git.c b/git.c
index 87d61f12594..39dc9f8ec0f 100644
--- a/git.c
+++ b/git.c
@@ -686,11 +686,9 @@ static void list_builtins(struct string_list *out, unsigned int include_option,
 			if (commands[i].option & include_option)
 				string_list_append(out, commands[i].cmd);
 	} else {
-		for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
-			if (commands[i].option & exclude_option)
-				continue;
-			string_list_append(out, commands[i].cmd);
-		}
+		for (size_t i = 0; i < ARRAY_SIZE(commands); i++)
+			if (!(commands[i].option & exclude_option))
+				string_list_append(out, commands[i].cmd);
 	}
 }
 
-- 
2.51.0.16.gcd94ab5bf81