mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Excludes: Optimize Desktop.ini check
This commit is contained in:
parent
7ab127ad53
commit
5d668eca40
2 changed files with 8 additions and 4 deletions
|
@ -310,11 +310,13 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(const QList<QByteArray> &exclud
|
|||
#endif
|
||||
|
||||
/* We create a desktop.ini on Windows for the sidebar icon, make sure we don't sync them. */
|
||||
if (blen == 11) {
|
||||
rc = csync_fnmatch("Desktop.ini", bname, 0);
|
||||
if (rc == 0) {
|
||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (!OCC::Utility::shouldUploadConflictFiles()) {
|
||||
if (OCC::Utility::isConflictFile(bname)) {
|
||||
|
|
|
@ -258,6 +258,8 @@ static void check_csync_excluded_traversal(void **)
|
|||
assert_int_equal(check_file_traversal(".sync_5bdd60bdfcfa.db-shm"), CSYNC_FILE_SILENTLY_EXCLUDED);
|
||||
assert_int_equal(check_file_traversal("subdir/.sync_5bdd60bdfcfa.db"), CSYNC_FILE_SILENTLY_EXCLUDED);
|
||||
|
||||
/* Other builtin excludes */
|
||||
assert_int_equal(check_file_traversal("foo/Desktop.ini"), CSYNC_FILE_SILENTLY_EXCLUDED);
|
||||
|
||||
/* pattern ]*.directory - ignore and remove */
|
||||
assert_int_equal(check_file_traversal("my.~directory"), CSYNC_FILE_EXCLUDE_AND_REMOVE);
|
||||
|
|
Loading…
Reference in a new issue