Update src/Backups/BackupIO_Disk.cpp

Co-authored-by: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com>
This commit is contained in:
alesapin 2022-08-24 17:45:26 +02:00 committed by GitHub
parent e865959ccc
commit 571778ad25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,12 +100,11 @@ bool BackupWriterDisk::supportNativeCopy(DataSourceDescription data_source_descr
void BackupWriterDisk::copyFileNative(std::shared_ptr<IDisk> from_disk, const String & file_name_from, const String & file_name_to)
{
if (!from_disk)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot natively copy data to disk without source disk");
auto file_path = path / file_name_to;
disk->createDirectories(file_path.parent_path());
if (from_disk)
from_disk->copyFile(file_name_from, *disk, file_path);
else
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot natively copy data to disk without source disk");
}
}