[Pkg-owncloud-commits] [owncloud] 27/129: don't move files in cache twice, fixes renaming for objectstores

David Prévot taffit at moszumanska.debian.org
Thu Nov 5 01:04:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 36066e1382c76b15577f399ed096227d71f7096c
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Tue Jul 14 15:12:27 2015 +0200

    don't move files in cache twice, fixes renaming for objectstores
---
 lib/private/files/cache/updater.php | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index 1e180e7..2de0c8f 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -171,13 +171,15 @@ class Updater {
 
 		if ($sourceStorage && $targetStorage) {
 			$targetCache = $targetStorage->getCache($sourceInternalPath);
-			if ($targetCache->inCache($targetInternalPath)) {
-				$targetCache->remove($targetInternalPath);
-			}
-			if ($sourceStorage === $targetStorage) {
-				$targetCache->move($sourceInternalPath, $targetInternalPath);
-			} else {
-				$targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath);
+			if ($sourceStorage->getCache($sourceInternalPath)->inCache($sourceInternalPath)) {
+				if ($targetCache->inCache($targetInternalPath)) {
+					$targetCache->remove($targetInternalPath);
+				}
+				if ($sourceStorage === $targetStorage) {
+					$targetCache->move($sourceInternalPath, $targetInternalPath);
+				} else {
+					$targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath);
+				}
 			}
 
 			if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list