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

This may be an issue with repositories imported with commit
27a1a8014b or later, but before
commit dad73c0bb9.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Eric Wong 2006-12-08 01:55:19 -08:00 коммит произвёл Junio C Hamano
Родитель db9819a40a
Коммит 006ede5e86
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -3438,6 +3438,9 @@ sub open_file {
my ($self, $path, $pb, $rev) = @_;
my ($mode, $blob) = (safe_qx('git-ls-tree',$self->{c},'--',$path)
=~ /^(\d{6}) blob ([a-f\d]{40})\t/);
unless (defined $mode && defined $blob) {
die "$path was not found in commit $self->{c} (r$rev)\n";
}
{ path => $path, mode_a => $mode, mode_b => $mode, blob => $blob,
pool => SVN::Pool->new, action => 'M' };
}