]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-svn: clone: Fail on missing url argument
authorChristopher Layne <clayne@anodized.com>
Sun, 3 Jul 2016 05:39:23 +0000 (05:39 +0000)
committerEric Wong <e@80x24.org>
Sun, 3 Jul 2016 06:04:47 +0000 (06:04 +0000)
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>
git-svn.perl

index 05eced06cde8a1ff83262d452dc8edbcc1f3dea8..f609e54ce3b3d5a0f004de6d40390a9fdae4f6a9 100755 (executable)
@@ -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\+]+://#) {