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
This commit is contained in:
Junio C Hamano 2015-07-01 14:02:33 -07:00
Родитель d70bc3b97a eb86a507a1
Коммит 58eb0122f3
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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)