{"thread":{"id":"64107","subject":"[PATCH 4/4] refs: enable sign compare warnings check","startedAt":"2025-09-07T16:40:52Z","lastAt":"2025-09-07T16:40:52Z","messageCount":1,"participants":["shejialuo"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"525716","messageId":"aL21kDwK-zGZyJ9q@ArchLinux","threadId":"64107","inReplyTo":null,"subject":"[PATCH 4/4] refs: enable sign compare warnings check","fromName":"shejialuo","fromEmail":"shejialuo@gmail.com","sentAt":"2025-09-07T16:40:48Z","receivedAt":"2025-09-07T16:40:52Z","isPatch":true,"sender":{"key":"shejialuo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56911263?v=4"},"body":"After fixing the tricky compare warning introduced by calling\n\"string_list_find_insert_index\", there are only two loop iterator type\nmismatches. Fix them to enable compare warnings check.\n\nSigned-off-by: shejialuo <shejialuo@gmail.com>\n---\n refs.c | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex a8f06b9a0a..79069c37b8 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -3,7 +3,6 @@\n  */\n \n #define USE_THE_REPOSITORY_VARIABLE\n-#define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n@@ -2381,7 +2380,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,\n \tstruct child_process proc = CHILD_PROCESS_INIT;\n \tstruct strbuf buf = STRBUF_INIT;\n \tconst char *hook;\n-\tint ret = 0, i;\n+\tint ret = 0;\n \n \thook = find_hook(transaction->ref_store->repo, \"reference-transaction\");\n \tif (!hook)\n@@ -2398,7 +2397,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,\n \n \tsigchain_push(SIGPIPE, SIG_IGN);\n \n-\tfor (i = 0; i < transaction->nr; i++) {\n+\tfor (size_t i = 0; i < transaction->nr; i++) {\n \t\tstruct ref_update *update = transaction->updates[i];\n \n \t\tif (update->flags & REF_LOG_ONLY)\n@@ -2791,9 +2790,7 @@ void ref_transaction_for_each_queued_update(struct ref_transaction *transaction,\n \t\t\t\t\t    ref_transaction_for_each_queued_update_fn cb,\n \t\t\t\t\t    void *cb_data)\n {\n-\tint i;\n-\n-\tfor (i = 0; i < transaction->nr; i++) {\n+\tfor (size_t i = 0; i < transaction->nr; i++) {\n \t\tstruct ref_update *update = transaction->updates[i];\n \n \t\tcb(update->refname,\n-- \n2.51.0\n\n"}]}