fetch-pack: fix hash_algo variable type
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pablo Sabater committed
Jul 10, 2026 at 18:41 UTC
af8bca204d061ca52829d210f640cb815cfd55b8
1 file changed
+1
-1
fetch-pack.c
+1
-1
@@ -1395,7 +1395,7 @@ static void write_fetch_command_and_capabilities(struct strbuf *req_buf,
1395
}
1396
1397
if (server_feature_v2("object-format", &hash_name)) {
1398
- int hash_algo = hash_algo_by_name(hash_name);
1398
+ const unsigned int hash_algo = hash_algo_by_name(hash_name);
1399
if (hash_algo_by_ptr(the_hash_algo) != hash_algo)
1400
die(_("mismatched algorithms: client %s; server %s"),
1401
the_hash_algo->name, hash_name);