Browse Source

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
maint
Junio C Hamano 8 years ago
parent
commit
a3228e4a4a
  1. 12
      perl/Git/SVN.pm

12
perl/Git/SVN.pm

@ -1663,7 +1663,17 @@ sub tie_for_persistent_memoization { @@ -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';
}
}


Loading…
Cancel
Save