summaryrefslogtreecommitdiff
path: root/perl/Git/SVN.pm
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-27 22:04:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-27 22:04:08 (GMT)
commita3228e4a4a621b63419c3e936211a7e1c9cb67a9 (patch)
tree112051c106f5514d52bc1f31efb18cf9524d3a8c /perl/Git/SVN.pm
parent251641b771c3b8d3ccf1f1cccd71e2c779eae41d (diff)
parenta2c761ce5b7a5fd8b505b036f3509a9e6617dee8 (diff)
downloadgit-a3228e4a4a621b63419c3e936211a7e1c9cb67a9.zip
git-a3228e4a4a621b63419c3e936211a7e1c9cb67a9.tar.gz
git-a3228e4a4a621b63419c3e936211a7e1c9cb67a9.tar.bz2
Merge branch 'svn-cache' of git://bogomips.org/git-svn
* 'svn-cache' of git://bogomips.org/git-svn: git-svn: do not reuse caches memoized for a different architecture
Diffstat (limited to 'perl/Git/SVN.pm')
-rw-r--r--perl/Git/SVN.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 499e84b..711d268 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1663,7 +1663,17 @@ sub tie_for_persistent_memoization {
if ($memo_backend > 0) {
tie %$hash => 'Git::SVN::Memoize::YAML', "$path.yaml";
} else {
- tie %$hash => 'Memoize::Storable', "$path.db", 'nstore';
+ # first verify that any existing file can actually be loaded
+ # (it may have been saved by an incompatible version)
+ my $db = "$path.db";
+ if (-e $db) {
+ use Storable qw(retrieve);
+
+ if (!eval { retrieve($db); 1 }) {
+ unlink $db or die "unlink $db failed: $!";
+ }
+ }
+ tie %$hash => 'Memoize::Storable', $db, 'nstore';
}
}