git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-svn: clone: Fail on missing url argument
@ 2016-07-03  5:39 Christopher Layne
  2016-07-03  6:15 ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Layne @ 2016-07-03  5:39 UTC (permalink / raw)
  To: git; +Cc: Eric Wong

* 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


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

end of thread, other threads:[~2016-07-06 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-03  5:39 [PATCH] git-svn: clone: Fail on missing url argument Christopher Layne
2016-07-03  6:15 ` Eric Wong
2016-07-03  6:49   ` Christopher Layne
2016-07-06 18:15   ` Junio C Hamano

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).