Skip to content

Commit a3228e4

Browse files
committed
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
2 parents 251641b + a2c761c commit a3228e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

perl/Git/SVN.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,17 @@ sub tie_for_persistent_memoization {
16631663
if ($memo_backend > 0) {
16641664
tie %$hash => 'Git::SVN::Memoize::YAML', "$path.yaml";
16651665
} else {
1666-
tie %$hash => 'Memoize::Storable', "$path.db", 'nstore';
1666+
# first verify that any existing file can actually be loaded
1667+
# (it may have been saved by an incompatible version)
1668+
my $db = "$path.db";
1669+
if (-e $db) {
1670+
use Storable qw(retrieve);
1671+
1672+
if (!eval { retrieve($db); 1 }) {
1673+
unlink $db or die "unlink $db failed: $!";
1674+
}
1675+
}
1676+
tie %$hash => 'Memoize::Storable', $db, 'nstore';
16671677
}
16681678
}
16691679

0 commit comments

Comments
 (0)