diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Updater.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php index aa025a3a96c..1280a2ae267 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -185,7 +185,15 @@ class Updater implements IUpdater { */ public function copyFromStorage(IStorage $sourceStorage, string $source, string $target): void { $this->copyOrRenameFromStorage($sourceStorage, $source, $target, function (ICache $sourceCache, ICacheEntry $sourceInfo) use ($target) { - $this->cache->copyFromCache($sourceCache, $sourceInfo, $target); + $parent = dirname($target); + $parentInCache = $this->cache->inCache($parent); + if (!$parentInCache) { + $parentData = $this->scanner->scan($parent, Scanner::SCAN_SHALLOW, -1, false); + $parentInCache = $parentData !== null; + } + if ($parentInCache) { + $this->cache->copyFromCache($sourceCache, $sourceInfo, $target); + } }); } |