aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-04 09:43:26 -0800
committerJunio C Hamano <gitster@pobox.com>2012-01-04 09:43:26 -0800
commit6ea938542610f4c7b978a2d8bac00fade72ce9f1 (patch)
tree4ce1dd3ea911cbf2da12cd10203248fd2dd46b60
parentbc0fe84b064d2185e147b7c1f98bb6f9b7966b2c (diff)
parente7622ce8c4c3d5c0a596ace7fb34afe0d1e273ef (diff)
downloadgit-6ea938542610f4c7b978a2d8bac00fade72ce9f1.tar.gz
git-6ea938542610f4c7b978a2d8bac00fade72ce9f1.tar.xz
Merge branch 'nd/maint-parse-depth' into maint
* nd/maint-parse-depth: Catch invalid --depth option passed to clone or fetch
-rw-r--r--transport.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index 9b25ea06b..72a9c292e 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;