[PATCH] git-svn: extra error check to ensure we open a file correctly
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Dec 8, 2006, 09:55 UTC
- Message-ID
- <20061208095519.GA27272@soma>
- In-Reply-To
- <20061204181241.GA27342@soma>
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> ---
Eric Wong <normalperson@yhbt.net> wrote:
Show 15 quoted lines
> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote: > > >>>>> "Eric" == Eric Wong <normalperson@yhbt.net> writes: > > > > Eric> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote: > > >> > > >> Does this ring a bell? > > > > Eric> Nope. > > > > Eric> This is on r15941 of https://svn.perl.org/parrot/trunk ? I can't seem > > Eric> to reproduce this with git svn fetch -r15940:15941 > > > > No, and that worked for me as well. Apparently, I might have corrupted my > > metadata because I updated git-svn while I was using it. Is there any way to > > reset the metadata without having to re-fetch 15000 revisions?
I fear I may have been looking in the wrong place while trying to diagnose merlyn's problem. He did mention he was on a flaky connection and that may have caused the corruption if he had one of those bad versions.
git-svn.perl | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl index 747daf0..ff61b92 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -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' }; }
-- 1.4.4.1.g9c35e-dirty