[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    [PATCH] git-svn: clone: Fail on missing url argument
From:       Christopher Layne <clayne () anodized ! com>
Date:       2016-07-03 5:39:23
Message-ID: 20160703053923.GA12956 () ns1 ! signalpunk ! com
[Download RAW message or body]

* 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic