refs: enable sign compare warnings check

After fixing the tricky compare warning introduced by calling "string_list_find_insert_index", there are only two loop iterator type mismatches. Fix them to enable compare warnings check. Signed-off-by: shejialuo <shejialuo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

shejialuo committed Oct 6, 2025 at 14:32 UTC 22e7bc801cd9c5e5b5c4489b631be28e506fec42
1 file changed +3 -6
refs.c
+3 -6
@@ -3,7 +3,6 @@
3 */
4
5 #define USE_THE_REPOSITORY_VARIABLE
6 -#define DISABLE_SIGN_COMPARE_WARNINGS
6
7 #include "git-compat-util.h"
8 #include "advice.h"
@@ -2381,7 +2380,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,
2380 struct child_process proc = CHILD_PROCESS_INIT;
2381 struct strbuf buf = STRBUF_INIT;
2382 const char *hook;
2384 - int ret = 0, i;
2383 + int ret = 0;
2384
2385 hook = find_hook(transaction->ref_store->repo, "reference-transaction");
2386 if (!hook)
@@ -2398,7 +2397,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,
2397
2398 sigchain_push(SIGPIPE, SIG_IGN);
2399
2401 - for (i = 0; i < transaction->nr; i++) {
2400 + for (size_t i = 0; i < transaction->nr; i++) {
2401 struct ref_update *update = transaction->updates[i];
2402
2403 if (update->flags & REF_LOG_ONLY)
@@ -2791,9 +2790,7 @@ void ref_transaction_for_each_queued_update(struct ref_transaction *transaction,
2790 ref_transaction_for_each_queued_update_fn cb,
2791 void *cb_data)
2792 {
2794 - int i;
2795 -
2796 - for (i = 0; i < transaction->nr; i++) {
2793 + for (size_t i = 0; i < transaction->nr; i++) {
2794 struct ref_update *update = transaction->updates[i];
2795
2796 cb(update->refname,