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>
This commit is contained in:
Christopher Layne 2016-07-03 05:39:23 +00:00 committed by Eric Wong
parent cf4c2cfe52
commit 19e9542fa2

View File

@ -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\+]+://#) {