@matheusbsbs / matheus-bagliano / commits / 006ede5e86
Fork 0

git-svn: extra error check to ensure we open a file correctly

This may be an issue with repositories imported with commit 27a1a8014b842c0d70fdc91c68dd361ca2dfb34c or later, but before commit dad73c0bb9f33323ec1aacf560a6263f1d85f81a. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Dec 8, 2006 at 01:55 UTC 006ede5e860717ff1ec68125393bcd4e74507e5b
1 file changed +3
git-svn.perl
+3
@@ -3438,6 +3438,9 @@ sub open_file {
3438 my ($self, $path, $pb, $rev) = @_;
3439 my ($mode, $blob) = (safe_qx('git-ls-tree',$self->{c},'--',$path)
3440 =~ /^(\d{6}) blob ([a-f\d]{40})\t/);
3441 + unless (defined $mode && defined $blob) {
3442 + die "$path was not found in commit $self->{c} (r$rev)\n";
3443 + }
3444 { path => $path, mode_a => $mode, mode_b => $mode, blob => $blob,
3445 pool => SVN::Pool->new, action => 'M' };
3446 }