@matheusbsbs / matheus-bagliano / commits / 48bf141589
Fork 0

fetch-pack: detect when the server doesn't support our hash

Detect when the server doesn't support our hash algorithm and abort. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed May 25, 2020 at 19:58 UTC 48bf1415896db0f890530dcd182f33c2f0df10a8
1 file changed +2
fetch-pack.c
+2
@@ -1039,6 +1039,8 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
1039 print_verbose(args, _("Server supports %s"), "deepen-relative");
1040 else if (args->deepen_relative)
1041 die(_("Server does not support --deepen"));
1042 + if (!server_supports_hash(the_hash_algo->name, NULL))
1043 + die(_("Server does not support this repository's object format"));
1044
1045 if (!args->no_dependents) {
1046 mark_complete_and_common_ref(negotiator, args, &ref);