diff options
| author | shejialuo <shejialuo@gmail.com> | 2025-10-06 14:32:48 +0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-06 09:11:08 -0700 |
| commit | 22e7bc801cd9c5e5b5c4489b631be28e506fec42 (patch) | |
| tree | 89dc4e122487d38d04aeeb849f40a4b61aa77fdd /refs.c | |
| parent | string-list: change "string_list_find_insert_index" return type to "size_t" (diff) | |
| download | git-22e7bc801cd9c5e5b5c4489b631be28e506fec42.tar.gz git-22e7bc801cd9c5e5b5c4489b631be28e506fec42.zip | |
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>
Diffstat (limited to 'refs.c')
| -rw-r--r-- | refs.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -3,7 +3,6 @@ */ #define USE_THE_REPOSITORY_VARIABLE -#define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.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 strbuf buf = STRBUF_INIT; const char *hook; - int ret = 0, i; + int ret = 0; hook = find_hook(transaction->ref_store->repo, "reference-transaction"); if (!hook) @@ -2398,7 +2397,7 @@ static int run_transaction_hook(struct ref_transaction *transaction, 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]; 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, void *cb_data) { - int i; - - for (i = 0; i < transaction->nr; i++) { + for (size_t i = 0; i < transaction->nr; i++) { struct ref_update *update = transaction->updates[i]; cb(update->refname, |
