mirror of
https://github.com/git/git.git
synced 2026-01-27 10:58:50 +00:00
Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user