refs: use `size_t` indexes when iterating over ref transaction updates
[gitweb.git] / refs / files-backend.c
index cb1f528cbeec47970dca1089121bb0280858896c..b2559b558556cadb7215c4cb366f6a3b8c2cb422 100644 (file)
@@ -105,7 +105,7 @@ static void clear_packed_ref_cache(struct files_ref_store *refs)
                struct packed_ref_cache *packed_refs = refs->packed;
 
                if (packed_refs->lock)
-                       die("internal error: packed-ref cache cleared while locked");
+                       die("BUG: packed-ref cache cleared while locked");
                refs->packed = NULL;
                release_packed_ref_cache(packed_refs);
        }
@@ -397,7 +397,7 @@ static void add_packed_ref(struct files_ref_store *refs,
        struct packed_ref_cache *packed_ref_cache = get_packed_ref_cache(refs);
 
        if (!packed_ref_cache->lock)
-               die("internal error: packed refs not locked");
+               die("BUG: packed refs not locked");
        add_ref_entry(get_packed_ref_dir(packed_ref_cache),
                      create_ref_entry(refname, oid, REF_ISPACKED, 1));
 }
@@ -1324,7 +1324,7 @@ static int commit_packed_refs(struct files_ref_store *refs)
        files_assert_main_repository(refs, "commit_packed_refs");
 
        if (!packed_ref_cache->lock)
-               die("internal error: packed-refs not locked");
+               die("BUG: packed-refs not locked");
 
        out = fdopen_lock_file(packed_ref_cache->lock, "w");
        if (!out)
@@ -1367,7 +1367,7 @@ static void rollback_packed_refs(struct files_ref_store *refs)
        files_assert_main_repository(refs, "rollback_packed_refs");
 
        if (!packed_ref_cache->lock)
-               die("internal error: packed-refs not locked");
+               die("BUG: packed-refs not locked");
        rollback_lock_file(packed_ref_cache->lock);
        packed_ref_cache->lock = NULL;
        release_packed_ref_cache(packed_ref_cache);
@@ -2850,7 +2850,8 @@ static int files_transaction_commit(struct ref_store *ref_store,
        struct files_ref_store *refs =
                files_downcast(ref_store, REF_STORE_WRITE,
                               "ref_transaction_commit");
-       int ret = 0, i;
+       size_t i;
+       int ret = 0;
        struct string_list refs_to_delete = STRING_LIST_INIT_NODUP;
        struct string_list_item *ref_to_delete;
        struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
@@ -3057,7 +3058,8 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
        struct files_ref_store *refs =
                files_downcast(ref_store, REF_STORE_WRITE,
                               "initial_ref_transaction_commit");
-       int ret = 0, i;
+       size_t i;
+       int ret = 0;
        struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
 
        assert(err);