diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index 152fb7e9274c77..a242bde6a5ffc5 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -1585,6 +1585,11 @@ sub tie_for_persistent_memoization { if ($memo_backend > 0) { tie %$hash => 'Git::SVN::Memoize::YAML', "$path.yaml"; } else { + # first verify that any existing file can actually be loaded + # (it may have been saved by an incompatible version) + if (-e "$path.db") { + unlink "$path.db" unless eval { retrieve("$path.db"); 1 }; + } tie %$hash => 'Memoize::Storable', "$path.db", 'nstore'; } }