Merge pull request #51559 from nextcloud/backport/50663/stable29

[stable29] enh: improve occ file:transfer-ownership logging
This commit is contained in:
Julius Knorr 2025-03-19 23:43:54 +01:00 committed by GitHub
commit 56ee6bd012
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,6 +167,8 @@ class OwnershipTransferService {
$sourcePath
);
$sourceSize = $view->getFileInfo($sourcePath)->getSize();
// transfer the files
$this->transferFiles(
$sourceUid,
@ -175,6 +177,7 @@ class OwnershipTransferService {
$view,
$output
);
$sizeDifference = $sourceSize - $view->getFileInfo($finalTarget)->getSize();
// transfer the incoming shares
if ($transferIncomingShares === true) {
@ -210,6 +213,9 @@ class OwnershipTransferService {
$shares,
$output
);
if ($sizeDifference !== 0) {
$output->writeln("Transferred folder have a size difference of: $sizeDifference Bytes which means the transfer may be incomplete. Please check the logs if there was any issue during the transfer operation.");
}
}
private function walkFiles(View $view, $path, Closure $callBack) {