From: Junio C Hamano Date: Wed, 4 Jan 2012 17:43:26 +0000 (-0800) Subject: Merge branch 'nd/maint-parse-depth' into maint X-Git-Tag: v1.7.8.3~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6ea938542610f4c7b978a2d8bac00fade72ce9f1?hp=bc0fe84b064d2185e147b7c1f98bb6f9b7966b2c Merge branch 'nd/maint-parse-depth' into maint * nd/maint-parse-depth: Catch invalid --depth option passed to clone or fetch --- diff --git a/transport.c b/transport.c index 9b25ea06b1..72a9c292e5 100644 --- a/transport.c +++ b/transport.c @@ -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; - else - 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;