提交 d52dc4b1 编写于 作者: J Jonathan Nieder 提交者: Junio C Hamano

clone: detect extra arguments

If git clone is given more than two non-option arguments, it
silently throws away all but the first one.  Complain instead.

Discovered by comparing the new builtin clone to the old
git-clone.sh.
Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 ebc9d420
......@@ -379,8 +379,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, builtin_clone_options,
builtin_clone_usage, 0);
if (argc > 2)
usage_msg_opt("Too many arguments.",
builtin_clone_usage, builtin_clone_options);
if (argc == 0)
die("You must specify a repository to clone.");
usage_msg_opt("You must specify a repository to clone.",
builtin_clone_usage, builtin_clone_options);
if (option_mirror)
option_bare = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册