summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-07-11 10:31:52 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-07-11 10:31:52 -0700
commit3f933701dc1b6249b050bbc96586929c3ffb6977 (patch)
treefe4d76ba8fd4b9333c8c84f89c479530b04f1c43
parentMerge branch 'js/color-on-windows-comment' (diff)
parentgit-svn: warn instead of dying when commit data is missing (diff)
downloadtgif-3f933701dc1b6249b050bbc96586929c3ffb6977.tar.xz
Merge branch 'master' of git://bogomips.org/git-svn
* 'master' of git://bogomips.org/git-svn: git-svn: warn instead of dying when commit data is missing git-svn: clone: Fail on missing url argument
-rwxr-xr-xgit-svn.perl5
-rw-r--r--perl/Git/SVN.pm8
2 files changed, 10 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 05eced06cd..f609e54ce3 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\+]+://#) {
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index bee1e7d1cb..018beb85a0 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -97,8 +97,12 @@ sub resolve_local_globs {
"existing: $existing\n",
" globbed: $refname\n";
}
- my $u = (::cmt_metadata("$refname"))[0] or die
- "$refname: no associated commit metadata\n";
+ my $u = (::cmt_metadata("$refname"))[0];
+ if (!defined($u)) {
+ warn
+"W: $refname: no associated commit metadata from SVN, skipping\n";
+ next;
+ }
$u =~ s!^\Q$url\E(/|$)!! or die
"$refname: '$url' not found in '$u'\n";
if ($pathname ne $u) {