aboutsummaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 12:03:29 -0800
committerJunio C Hamano <gitster@pobox.com>2013-12-17 12:03:29 -0800
commit88cb2f96aca8ca8e454e8aa532e54c3c629dbb62 (patch)
treebf21d457e0719e11d70fc9c0d22452a79a80bccf /builtin/clone.c
parentad7044857660af7ffaaf8fbbccc77b817d1b938f (diff)
parent5594bcad21da70d2e9704cf96baa91b8d99dc27b (diff)
downloadgit-88cb2f96aca8ca8e454e8aa532e54c3c629dbb62.tar.gz
git-88cb2f96aca8ca8e454e8aa532e54c3c629dbb62.tar.xz
Merge branch 'nd/transport-positive-depth-only'
"git fetch --depth=0" was a no-op, and was silently ignored. Diagnose it as an error. * nd/transport-positive-depth-only: clone,fetch: catch non positive --depth option value
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index ec4d1cd2b..f98f52980 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -796,6 +796,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_local > 0 && !is_local)
warning(_("--local is ignored"));
+ /* no need to be strict, transport_set_option() will validate it again */
+ if (option_depth && atoi(option_depth) < 1)
+ die(_("depth %s is not a positive number"), option_depth);
+
if (argc == 2)
dir = xstrdup(argv[1]);
else