[PATCH GSoC v18 04/13] fetch-pack: fix hash_algo variable type
- From
Pablo Sabater <pabloosabaterr@gmail.com>
- Date
- Jul 15, 2026, 09:52 UTC
- Message-ID
- <20260715-ps-eric-work-rebase-v18-4-34d7adb051bb@gmail.com>
- In-Reply-To
- <20260715-ps-eric-work-rebase-v18-0-34d7adb051bb@gmail.com>
hash_algo_by_name() returns "unsigned int", but the variable that it is assigned to is "int".
Change hash_algo variable type to match hash_algo_by_name() type, also make it const because it is never modified.
Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> --- fetch-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fetch-pack.c b/fetch-pack.c index f13951d154..eea72b2500 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1395,7 +1395,7 @@ static void write_fetch_command_and_capabilities(struct strbuf *req_buf, } if (server_feature_v2("object-format", &hash_name)) { - int hash_algo = hash_algo_by_name(hash_name); + const unsigned int hash_algo = hash_algo_by_name(hash_name); if (hash_algo_by_ptr(the_hash_algo) != hash_algo) die(_("mismatched algorithms: client %s; server %s"), the_hash_algo->name, hash_name);
-- 2.54.0