aboutsummaryrefslogtreecommitdiffstats
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2025-01-22 06:35:48 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-22 09:51:36 -0800
commite7c1b9f1231e49f5e0c5250ec84c68376619f415 (patch)
tree4b3ad66596503bd03c0fd52aa5c78b4d4f447205 /refs/refs-internal.h
parentrefs: mark `ref_transaction_update_reflog()` as static (diff)
downloadgit-e7c1b9f1231e49f5e0c5250ec84c68376619f415.tar.gz
git-e7c1b9f1231e49f5e0c5250ec84c68376619f415.zip
refs: use 'uint64_t' for 'ref_update.index'
The 'ref_update.index' variable is used to store an index for a given reference update. This index is used to order the updates in a predetermined order, while the default ordering is alphabetical as per the refname. For large repositories with millions of references, it should be safer to use 'uint64_t'. Let's do that. This also is applied for all other code sections where we store 'index' and pass it around. Reported-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index aaab711bb9..8894b43d1d 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -120,7 +120,7 @@ struct ref_update {
* when migrating reflogs and we want to ensure we carry over the
* same order.
*/
- unsigned int index;
+ uint64_t index;
/*
* If this ref_update was split off of a symref update via
@@ -203,7 +203,7 @@ struct ref_transaction {
enum ref_transaction_state state;
void *backend_data;
unsigned int flags;
- unsigned int max_index;
+ uint64_t max_index;
};
/*