Skip to content

Commit 22e7bc8

Browse files
shejialuogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51c3385 commit 22e7bc8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

refs.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44

55
#define USE_THE_REPOSITORY_VARIABLE
6-
#define DISABLE_SIGN_COMPARE_WARNINGS
76

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

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

23992398
sigchain_push(SIGPIPE, SIG_IGN);
24002399

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

24042403
if (update->flags & REF_LOG_ONLY)
@@ -2791,9 +2790,7 @@ void ref_transaction_for_each_queued_update(struct ref_transaction *transaction,
27912790
ref_transaction_for_each_queued_update_fn cb,
27922791
void *cb_data)
27932792
{
2794-
int i;
2795-
2796-
for (i = 0; i < transaction->nr; i++) {
2793+
for (size_t i = 0; i < transaction->nr; i++) {
27972794
struct ref_update *update = transaction->updates[i];
27982795

27992796
cb(update->refname,

0 commit comments

Comments
 (0)