Merge pull request #49695 from nextcloud/copy-update-cache-excluded

This commit is contained in:
John Molakvoæ 2024-12-11 08:40:49 +01:00 committed by GitHub
commit ed54713e6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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