From: Jonathan Nieder Date: Thu, 29 Oct 2009 08:10:30 GMT Subject: [PATCH] clone: detect extra arguments Message-ID: <20091029081030.GA11213@progeny.tock> 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: Jonathan Nieder --- builtin-clone.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/builtin-clone.c b/builtin-clone.c index 5762a6f..76ad581 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -377,6 +377,9 @@ 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) + die("Too many arguments."); + if (argc == 0) die("You must specify a repository to clone."); -- 1.6.5.2