Skip to content

Commit

Permalink
fix test and code to not stop on case clash errors
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Nov 30, 2022
1 parent b687548 commit af49e10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libsync/propagatorjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void PropagateLocalMkdir::startLocalMkdir()

if (Utility::fsCasePreserving() && propagator()->localFileNameClash(_item->_file)) {
qCWarning(lcPropagateLocalMkdir) << "New folder to create locally already exists with different case:" << _item->_file;
done(SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr));
done(SyncFileItem::FileNameClash, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr));
return;
}
emit propagator()->touchedFile(newDirStr);
Expand Down
12 changes: 6 additions & 6 deletions test/testsyncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,20 +1287,20 @@ private slots:
{
FakeFolder fakeFolder{ FileInfo{} };
fakeFolder.remoteModifier().mkdir("A");
fakeFolder.remoteModifier().mkdir("toDelete");
fakeFolder.remoteModifier().insert("A/file");

QVERIFY(fakeFolder.syncOnce());
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());

fakeFolder.remoteModifier().insert("A/FILE");
QVERIFY(!fakeFolder.syncOnce());
QVERIFY(fakeFolder.syncOnce());

fakeFolder.remoteModifier().mkdir("B");
fakeFolder.remoteModifier().rename("A/file", "B/file");
fakeFolder.remoteModifier().remove("A");
fakeFolder.remoteModifier().mkdir("a");
fakeFolder.remoteModifier().remove("toDelete");

QVERIFY(!fakeFolder.syncOnce());
auto folderA = fakeFolder.currentLocalState().find("A");
QVERIFY(fakeFolder.syncOnce());
auto folderA = fakeFolder.currentLocalState().find("toDelete");
QCOMPARE(folderA, nullptr);
}
};
Expand Down

0 comments on commit af49e10

Please sign in to comment.