diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-07-15 11:41:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-15 11:41:20 -0700 |
commit | eca143b72194836b758522f182d4f9b24b9c5967 (patch) | |
tree | 057852cedb53216f707a5fdd5227ee343af25d97 | |
parent | 697f67ac9fc88d01ec61801aba6e4c788b8a5c7d (diff) | |
parent | eb86a507a150b8fbb34fb4e59bf9edbefbbad778 (diff) | |
download | git-eca143b72194836b758522f182d4f9b24b9c5967.tar.gz |
Merge branch 'me/fetch-into-shallow-safety' into maint
"git fetch --depth=<depth>" and "git clone --depth=<depth>" issued
a shallow transfer request even to an upload-pack that does not
support the capability.
* me/fetch-into-shallow-safety:
fetch-pack: check for shallow if depth given
-rw-r--r-- | fetch-pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 48526aa54b..849a9d6275 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -790,7 +790,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args, sort_ref_list(&ref, ref_compare_name); qsort(sought, nr_sought, sizeof(*sought), cmp_ref_by_name); - if (is_repository_shallow() && !server_supports("shallow")) + if ((args->depth > 0 || is_repository_shallow()) && !server_supports("shallow")) die("Server does not support shallow clients"); if (server_supports("multi_ack_detailed")) { if (args->verbose) |