mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
Merge branch 'nd/maint-parse-depth' into maint
* nd/maint-parse-depth: Catch invalid --depth option passed to clone or fetch
This commit is contained in:
commit
6ea9385426
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue