summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-12 20:34:41 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-12 20:34:41 +0200
commit048fba723dfc61ae55ae4a95c96c038f19fe1aed (patch)
tree0432b953f02edea4c572e0d3dbe23b935cbf2e42
parent37801e172e29f70ff4657ac1ab81967ec1ae603e (diff)
downloadApp-BorgRestore-048fba723dfc61ae55ae4a95c96c038f19fe1aed.tar.gz
App-BorgRestore-048fba723dfc61ae55ae4a95c96c038f19fe1aed.tar.xz
Ensure that top level directories are also written to the DB
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--lib/App/BorgRestore/PathTimeTable/DB.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/App/BorgRestore/PathTimeTable/DB.pm b/lib/App/BorgRestore/PathTimeTable/DB.pm
index 71c2804..3d080d1 100644
--- a/lib/App/BorgRestore/PathTimeTable/DB.pm
+++ b/lib/App/BorgRestore/PathTimeTable/DB.pm
@@ -68,6 +68,10 @@ method add_path($path, $time) {
}
$path = substr($path, 0, $slash_index);
}
+
+ # 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 ".";
+
my $cached = $self->{cache}->{$path};
if (!defined $cached || $cached < $time) {
$log->tracef("Setting cache time for path '%s' to %d", $path, $time) if TRACE;