git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clone: detect extra arguments
@ 2009-10-29  8:10 Jonathan Nieder
  2009-10-29 16:06 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2009-10-29  8:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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 <jrnieder@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-31 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29  8:10 [PATCH] clone: detect extra arguments Jonathan Nieder
2009-10-29 16:06 ` Jeff King
2009-10-30 11:19   ` Jonathan Nieder
2009-10-30 14:45     ` Jeff King
2009-10-30 14:51       ` Jeff King
2009-10-31 11:32         ` Johan Herland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).