From 048fba723dfc61ae55ae4a95c96c038f19fe1aed Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 12 Sep 2018 20:34:41 +0200 Subject: Ensure that top level directories are also written to the DB Signed-off-by: Florian Pritz --- lib/App/BorgRestore/PathTimeTable/DB.pm | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3-24-g4f1b