Merge pull request #246 from uecasm/patch-1

Verify memoized files can be reloaded before using them
This commit is contained in:
Johannes Schindelin
2016-08-12 16:06:48 +02:00

View File

@@ -1654,6 +1654,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';
}
}