Skip to content

Commit

Permalink
in case of a case clash, verify also once the file is downloaded
Browse files Browse the repository at this point in the history
it could be that when starting the download job, no conflict would
exists but when receiving the file, a conflict would know exists

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Dec 1, 2022
1 parent 042b2d7 commit 32c1a08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,12 @@ void PropagateDownloadFile::downloadFinished()
qCWarning(lcPropagateDownload()) << "invalid modified time" << _item->_file << _item->_modtime;
}

bool previousFileExists = FileSystem::fileExists(filename);
if (propagator()->localFileNameClash(_item->_file)) {
_item->_instruction = CSYNC_INSTRUCTION_CASE_CLASH_CONFLICT;
qCInfo(lcPropagateDownload) << "setting instruction to" << _item->_instruction << _item->_file;
}

bool previousFileExists = FileSystem::fileExists(filename) && _item->_instruction != CSYNC_INSTRUCTION_CASE_CLASH_CONFLICT;
if (previousFileExists) {
// Preserve the existing file permissions.
QFileInfo existingFile(filename);
Expand Down

0 comments on commit 32c1a08

Please sign in to comment.