diff options
| author | brian m. carlson <sandals@crustytoothpaste.net> | 2026-02-07 20:04:33 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-07 17:41:01 -0800 |
| commit | 67e526c33e025918c146c7cb61007cc2ffc46661 (patch) | |
| tree | 3ebe08b801c7f4498e6e9ab01608dd19b463205d /repository.c | |
| parent | 9c317a68b7abc82a9c3c024baa318a29da970c4f (diff) | |
| download | git-67e526c33e025918c146c7cb61007cc2ffc46661.tar.xz | |
hash: use uint32_t for object_id algorithm
We currently use an int for this value, but we'll define this structure
from Rust in a future commit and we want to ensure that our data types
are exactly identical. To make that possible, use a uint32_t for the
hash algorithm.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.c')
| -rw-r--r-- | repository.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/repository.c b/repository.c index 9ebbb7afd8..08422d2188 100644 --- a/repository.c +++ b/repository.c @@ -39,7 +39,7 @@ struct repository *the_repository = &the_repo; static void set_default_hash_algo(struct repository *repo) { const char *hash_name; - int algo; + uint32_t algo; hash_name = getenv("GIT_TEST_DEFAULT_HASH_ALGO"); if (!hash_name) @@ -179,12 +179,12 @@ void repo_set_gitdir(struct repository *repo, repo->gitdir, "index"); } -void repo_set_hash_algo(struct repository *repo, int hash_algo) +void repo_set_hash_algo(struct repository *repo, uint32_t hash_algo) { repo->hash_algo = &hash_algos[hash_algo]; } -void repo_set_compat_hash_algo(struct repository *repo MAYBE_UNUSED, int algo) +void repo_set_compat_hash_algo(struct repository *repo MAYBE_UNUSED, uint32_t algo) { #ifdef WITH_RUST if (hash_algo_by_ptr(repo->hash_algo) == algo) |
