Browse Source

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

* nd/maint-parse-depth:
  Catch invalid --depth option passed to clone or fetch
maint
Junio C Hamano 13 years ago
parent
commit
6ea9385426
  1. 8
      transport.c

8
transport.c

@ -474,8 +474,12 @@ static int set_git_option(struct git_transport_options *opts,
} else if (!strcmp(name, TRANS_OPT_DEPTH)) { } else if (!strcmp(name, TRANS_OPT_DEPTH)) {
if (!value) if (!value)
opts->depth = 0; opts->depth = 0;
else else {
opts->depth = atoi(value); char *end;
opts->depth = strtol(value, &end, 0);
if (*end)
die("transport: invalid depth option '%s'", value);
}
return 0; return 0;
} }
return 1; return 1;

Loading…
Cancel
Save