Browse Source

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>
maint
brian m. carlson 5 years ago committed by Junio C Hamano
parent
commit
48bf141589
  1. 2
      fetch-pack.c

2
fetch-pack.c

@ -1039,6 +1039,8 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, @@ -1039,6 +1039,8 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
print_verbose(args, _("Server supports %s"), "deepen-relative");
else if (args->deepen_relative)
die(_("Server does not support --deepen"));
if (!server_supports_hash(the_hash_algo->name, NULL))
die(_("Server does not support this repository's object format"));

if (!args->no_dependents) {
mark_complete_and_common_ref(negotiator, args, &ref);

Loading…
Cancel
Save