diff options
author | Eric Wong <e@80x24.org> | 2016-07-02 10:33:18 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-06 11:29:58 -0700 |
commit | aa079c039e46750090c802e88d58321b41c62098 (patch) | |
tree | 83b6e38563ce684e820772ba1e3d6c2334813824 | |
parent | 523a33ca17c76bee007d7394fb3930266c577c02 (diff) | |
download | git-ew/svn-bad-ref.tar.gz |
git-svn: warn instead of dying when commit data is missingew/svn-bad-ref
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>
-rw-r--r-- | perl/Git/SVN.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index d94d01cfdc..fd26e2948d 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) { |