Vfs: Make move detection work with virtual files #7001
authorChristian Kamm <mail@ckamm.de>
Wed, 24 Jul 2019 13:07:20 +0000 (15:07 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:54 +0000 (10:58 +0100)
Previously a checksum computation could be done on a suffix-placeholder
file, making discovery believe that no move took place.

src/libsync/discovery.cpp

index e0f8cadf608ca20a10af00d7efe0b764810135f8..97a5e9aca4f15ab5d65f8dcd8d960b041504d706 100644 (file)
@@ -881,7 +881,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
         }
 
         // Verify the checksum where possible
-        if (!base._checksumHeader.isEmpty() && item->_type == ItemTypeFile) {
+        if (!base._checksumHeader.isEmpty() && item->_type == ItemTypeFile && base._type == ItemTypeFile) {
             if (computeLocalChecksum(base._checksumHeader, _discoveryData->_localDir + path._original, item)) {
                 qCInfo(lcDisco) << "checking checksum of potential rename " << path._original << item->_checksumHeader << base._checksumHeader;
                 if (item->_checksumHeader != base._checksumHeader) {