git-svn: clone: Fail on missing url argument

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> Signed-off-by: Eric Wong <e@80x24.org>

Christopher Layne committed Jul 3, 2016 at 05:39 UTC 19e9542fa29ec3027a5169ac5d1fc740405dc234
1 file changed +4 -1
git-svn.perl
+4 -1
@@ -507,7 +507,10 @@ sub init_subdir {
507
508 sub cmd_clone {
509 my ($url, $path) = @_;
510 - if (!defined $path &&
510 + if (!$url) {
511 + die "SVN repository location required ",
512 + "as a command-line argument\n";
513 + } elsif (!defined $path &&
514 (defined $_trunk || @_branches || @_tags ||
515 defined $_stdlayout) &&
516 $url !~ m#^[a-z\+]+://#) {