Commit 6ea93854 authored by Junio C Hamano's avatar Junio C Hamano

Merge branch 'nd/maint-parse-depth' into maint

* nd/maint-parse-depth:
  Catch invalid --depth option passed to clone or fetch
parents bc0fe84b e7622ce8
......@@ -474,8 +474,12 @@ static int set_git_option(struct git_transport_options *opts,
} else if (!strcmp(name, TRANS_OPT_DEPTH)) {
if (!value)
opts->depth = 0;
opts->depth = atoi(value);
else {
char *end;
opts->depth = strtol(value, &end, 0);
if (*end)
die("transport: invalid depth option '%s'", value);
return 0;
return 1;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment