提交 e7622ce8 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

Catch invalid --depth option passed to clone or fetch

Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 15b7898c
......@@ -472,8 +472,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册