git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Layne <clayne@anodized.com>
To: git@vger.kernel.org
Cc: Eric Wong <normalperson@yhbt.net>
Subject: [PATCH] git-svn: clone: Fail on missing url argument
Date: Sun, 3 Jul 2016 05:39:23 +0000	[thread overview]
Message-ID: <20160703053923.GA12956@ns1.signalpunk.com> (raw)

* cmd_clone should detect a missing $url arg before using it otherwise
  an uninitialized value error is emitted in even the simplest case of
  'git svn clone' without arguments.

Signed-off-by: Christopher Layne <clayne@anodized.com>
---
 git-svn.perl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/git-svn.perl b/git-svn.perl
index 05eced0..f609e54 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -507,7 +507,10 @@ sub init_subdir {
 
 sub cmd_clone {
 	my ($url, $path) = @_;
-	if (!defined $path &&
+	if (!$url) {
+		die "SVN repository location required ",
+		    "as a command-line argument\n";
+	} elsif (!defined $path &&
 	    (defined $_trunk || @_branches || @_tags ||
 	     defined $_stdlayout) &&
 	    $url !~ m#^[a-z\+]+://#) {
-- 
2.7.3


             reply	other threads:[~2016-07-03  5:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03  5:39 Christopher Layne [this message]
2016-07-03  6:15 ` [PATCH] git-svn: clone: Fail on missing url argument Eric Wong
2016-07-03  6:49   ` Christopher Layne
2016-07-06 18:15   ` Junio C Hamano

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=20160703053923.GA12956@ns1.signalpunk.com \
    --to=clayne@anodized.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /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).