Merge pull request #52190 from nextcloud/backport/49695/stable29

This commit is contained in:
John Molakvoæ 2025-04-15 16:59:52 +02:00 committed by GitHub
commit f84f0809fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,7 +205,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);
}
});
}