summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-05-25 19:58:59 +0000
committerJunio C Hamano <gitster@pobox.com>2020-05-27 10:07:06 -0700
commit48bf1415896db0f890530dcd182f33c2f0df10a8 (patch)
treef9bb823b2444b9aadcd6a9d4d56fcf428e47b5b6 /fetch-pack.c
parent84eca27aebeb11ce96441f957f2595c28d89fe36 (diff)
downloadgit-48bf1415896db0f890530dcd182f33c2f0df10a8.tar.gz
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>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index f73a2ce6cb..1d277190e7 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -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);