1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-09 16:26:46 +02:00

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 committed by Junio C Hamano
parent db9819a40a
commit 006ede5e86

View File

@ -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' };
}