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
This commit is contained in:
Junio C Hamano
2013-12-17 12:03:29 -08:00
2 changed files with 8 additions and 0 deletions

View File

@ -1079,6 +1079,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);