From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] clone: detect extra arguments
Date: Thu, 29 Oct 2009 03:10:30 -0500 [thread overview]
Message-ID: <20091029081030.GA11213@progeny.tock> (raw)
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
next reply other threads:[~2009-10-29 8:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 8:10 Jonathan Nieder [this message]
2009-10-29 16:06 ` [PATCH] clone: detect extra arguments 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091029081030.GA11213@progeny.tock \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).