Skip to content

Commit

Permalink
fix: Move version instead of copying it when restoring
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Sep 13, 2024
1 parent eebc9ad commit 99e95f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ public function rollback(IVersion $version): void {
$targetInternalPath = $version->getSourceFile()->getInternalPath();
$versionInternalPath = $version->getVersionFile()->getInternalPath();

$targetMount->getStorage()->copyFromStorage($versionMount->getStorage(), $versionInternalPath, $targetInternalPath);
$versionMount->getStorage()->getCache()->copyFromCache($targetCache, $versionCache->get($versionInternalPath), $targetMount->getSourcePath() . '/' . $targetInternalPath);
$targetMount->getStorage()->moveFromStorage($versionMount->getStorage(), $versionInternalPath, $targetInternalPath);
$versionMount->getStorage()->getCache()->moveFromCache($targetCache, $versionCache->get($versionInternalPath), $targetMount->getSourcePath() . '/' . $targetInternalPath);
}

Check failure on line 226 in lib/Versions/VersionsBackend.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidArgument

lib/Versions/VersionsBackend.php:226:72: InvalidArgument: Argument 2 of OCP\Files\Cache\ICache::moveFromCache expects string, but OCP\Files\Cache\ICacheEntry|false provided (see https://psalm.dev/004)

public function read(IVersion $version) {
Expand Down

0 comments on commit 99e95f2

Please sign in to comment.