diff options
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 564705555b..72930fcfdf 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1045,6 +1045,10 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) } } + /* no need to be strict, transport_set_option() will validate it again */ + if (depth && atoi(depth) < 1) + die(_("depth %s is not a positive number"), depth); + if (recurse_submodules != RECURSE_SUBMODULES_OFF) { if (recurse_submodules_default) { int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default); |