Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'me/fetch-into-shallow-safety'
author
Junio C Hamano
<gitster@pobox.com>
Wed, 1 Jul 2015 21:02:33 +0000
(14:02 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 1 Jul 2015 21:02:33 +0000
(14:02 -0700)
"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
fetch-pack.c
patch
|
blob
|
history
raw
(from parent 1:
d70bc3b
)
diff --git
a/fetch-pack.c
b/fetch-pack.c
index a912935a63c225b49eb67174d4142de41758dbe8..a1367721527a6a354e80da76088c341eb1273bd5 100644
(file)
--- 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)