summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-07-01 14:02:33 -0700
committerJunio C Hamano <gitster@pobox.com>2015-07-01 14:02:33 -0700
commit58eb0122f3f4799a1b7a3ce836e52dcb2dad45bd (patch)
tree9ceae7879b7970a35d5d9e5f9015ef916d1bdc70 /fetch-pack.c
parentd70bc3b97a4792ba99117ac6b0051ff367d78419 (diff)
parenteb86a507a150b8fbb34fb4e59bf9edbefbbad778 (diff)
downloadgit-58eb0122f3f4799a1b7a3ce836e52dcb2dad45bd.tar.gz
Merge branch 'me/fetch-into-shallow-safety'
"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
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index a912935a63..a136772152 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -809,7 +809,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)