summaryrefslogtreecommitdiffstats
path: root/lib/App
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App')
-rw-r--r--lib/App/BorgRestore/PathTimeTable/DB.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/App/BorgRestore/PathTimeTable/DB.pm b/lib/App/BorgRestore/PathTimeTable/DB.pm
index f92d24c..069d991 100644
--- a/lib/App/BorgRestore/PathTimeTable/DB.pm
+++ b/lib/App/BorgRestore/PathTimeTable/DB.pm
@@ -100,9 +100,10 @@ method add_path($path, $time) {
}
$log->tracef("Cache invalidation complete") if TRACE;
- if ($old_cache_path ne substr($path, 0, length($old_cache_path))) {
+ my $cache_check_path = $old_cache_path.'/';
+ if ($cache_check_path ne substr($path, 0, length($cache_check_path))) {
# ensure that top level directory is also written
- $self->_add_path_to_db($self->{archive_id}, $old_cache_path, $self->{cache}->{$old_cache_path}) unless $old_cache_path eq ".";
+ $self->_add_path_to_db($self->{archive_id}, $old_cache_path, $self->{cache}->{$old_cache_path}) unless ($old_cache_path eq "." or $old_cache_path eq '');
}
my $cached = $self->{cache}->{$path};