mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Merge pull request #2868 from nextcloud/vfs_cfapi_dont_mistake_unpinned_directory_for_files_to_dehydrate
Don't treat new folders in unpinned folders as files to dehydrate
This commit is contained in:
commit
90a7f583b2
2 changed files with 31 additions and 2 deletions
|
@ -187,8 +187,10 @@ bool VfsCfApi::statTypeVirtualFile(csync_file_stat_t *stat, void *statData)
|
|||
// It's a dir with a reparse point due to the placeholder info (hence the cloud tag)
|
||||
// if we don't remove the reparse point flag the discovery will end up thinking
|
||||
// it is a file... let's prevent it
|
||||
if (isDirectory && hasReparsePoint && hasCloudTag) {
|
||||
ffd->dwFileAttributes &= ~FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
if (isDirectory) {
|
||||
if (hasReparsePoint && hasCloudTag) {
|
||||
ffd->dwFileAttributes &= ~FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
}
|
||||
return false;
|
||||
} else if (isSparseFile && isPinned) {
|
||||
stat->type = ItemTypeVirtualFileDownload;
|
||||
|
|
|
@ -1067,6 +1067,33 @@ private slots:
|
|||
QCOMPARE(*vfs->pinState("onlinerenamed2/file1rename"), PinState::OnlineOnly);
|
||||
}
|
||||
|
||||
void testEmptyFolderInOnlineOnlyRoot()
|
||||
{
|
||||
FakeFolder fakeFolder{ FileInfo() };
|
||||
setupVfs(fakeFolder);
|
||||
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||
ItemCompletedSpy completeSpy(fakeFolder);
|
||||
|
||||
auto cleanup = [&]() {
|
||||
completeSpy.clear();
|
||||
};
|
||||
cleanup();
|
||||
|
||||
// OnlineOnly forced on the root
|
||||
setPinState(fakeFolder.localPath(), PinState::OnlineOnly, cfapi::NoRecurse);
|
||||
|
||||
// No effect sync
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||
cleanup();
|
||||
|
||||
// Add an empty folder which should propagate
|
||||
fakeFolder.localModifier().mkdir("A");
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||
cleanup();
|
||||
}
|
||||
|
||||
void testIncompatiblePins()
|
||||
{
|
||||
FakeFolder fakeFolder{ FileInfo() };
|
||||
|
|
Loading…
Reference in a new issue