Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'nd/maint-parse-depth' into maint
author
Junio C Hamano
<gitster@pobox.com>
Wed, 4 Jan 2012 17:43:26 +0000
(09:43 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 4 Jan 2012 17:43:26 +0000
(09:43 -0800)
* nd/maint-parse-depth:
Catch invalid --depth option passed to clone or fetch
transport.c
patch
|
blob
|
history
raw
(from parent 1:
bc0fe84
)
diff --git
a/transport.c
b/transport.c
index 9b25ea06b1770395f650ea44618ecb1c425149bc..72a9c292e5bcf00b226de6682656a5390e5c6ca2 100644
(file)
--- 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;