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>
main
shejialuo 2025-10-06 14:32:48 +08:00 committed by Junio C Hamano
parent 51c3385e37
commit 22e7bc801c
1 changed files with 3 additions and 6 deletions

9
refs.c
View File

@ -3,7 +3,6 @@
*/ */


#define USE_THE_REPOSITORY_VARIABLE #define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS


#include "git-compat-util.h" #include "git-compat-util.h"
#include "advice.h" #include "advice.h"
@ -2381,7 +2380,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,
struct child_process proc = CHILD_PROCESS_INIT; struct child_process proc = CHILD_PROCESS_INIT;
struct strbuf buf = STRBUF_INIT; struct strbuf buf = STRBUF_INIT;
const char *hook; const char *hook;
int ret = 0, i; int ret = 0;


hook = find_hook(transaction->ref_store->repo, "reference-transaction"); hook = find_hook(transaction->ref_store->repo, "reference-transaction");
if (!hook) if (!hook)
@ -2398,7 +2397,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,


sigchain_push(SIGPIPE, SIG_IGN); sigchain_push(SIGPIPE, SIG_IGN);


for (i = 0; i < transaction->nr; i++) { for (size_t i = 0; i < transaction->nr; i++) {
struct ref_update *update = transaction->updates[i]; struct ref_update *update = transaction->updates[i];


if (update->flags & REF_LOG_ONLY) if (update->flags & REF_LOG_ONLY)
@ -2791,9 +2790,7 @@ void ref_transaction_for_each_queued_update(struct ref_transaction *transaction,
ref_transaction_for_each_queued_update_fn cb, ref_transaction_for_each_queued_update_fn cb,
void *cb_data) void *cb_data)
{ {
int i; for (size_t i = 0; i < transaction->nr; i++) {

for (i = 0; i < transaction->nr; i++) {
struct ref_update *update = transaction->updates[i]; struct ref_update *update = transaction->updates[i];


cb(update->refname, cb(update->refname,