Skip to content

Commit

Permalink
git-svn: warn instead of dying when commit data is missing
Browse files Browse the repository at this point in the history
It is possible to have refs globbed by git-svn which stores data
purely in git; gently skip those instead of dying and assuming
user error.

ref: http://mid.gmane.org/CALi1mtdtNF_GtzyPTbfb7N51wwxsFY7zm8hsgwxr3tHcZZboyg@mail.gmail.com

Suggested-by: Jacob Godserv <jacobgodserv@gmail.com>
Cc: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong committed Jul 9, 2016
1 parent 19e9542 commit 2af7da9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions perl/Git/SVN.pm
Expand Up @@ -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) {
Expand Down

0 comments on commit 2af7da9

Please sign in to comment.