Fix onedrive not syncing "hidden" directories

* Fix the handling of hidden filenames & directories (.hello, .git etc)
so that these are uploaded / downloaded without issue.
* Add verbose logging for uploaded files as to why they were skipped
This commit is contained in:
abraunegg 2018-04-11 13:02:06 +10:00
parent 5e0e763317
commit 570d42269e
2 changed files with 11 additions and 1 deletions

View file

@ -29,7 +29,14 @@ final class SelectiveSync
bool isNameExcluded(string name)
{
return !name.matchFirst(mask).empty;
auto validName = isValidFilename(name);
if (validName){
// This is a valid filename - do NOT exclude
return false;
} else {
// Invalid file name - exclude this name
return true;
}
}
bool isPathExcluded(string path)

View file

@ -715,15 +715,18 @@ final class SyncEngine
// skip unexisting symbolic links
if (isSymlink(path) && !exists(readLink(path))) {
log.vlog("Skipping item - symbolic link: ", path);
return;
}
// skip filtered items
if (path != ".") {
if (selectiveSync.isNameExcluded(baseName(path))) {
log.vlog("Skipping item - invalid name: ", path);
return;
}
if (selectiveSync.isPathExcluded(path)) {
log.vlog("Skipping item - path excluded: ", path);
return;
}
}