With this change we emulate a case sensitive filesystem on top of insensitive filesystems. This means we correctly pick up case-only renames and throw a case conflict error when there would be multiple files differing only in case. This safety check has a small performance hit (about 20% more filesystem operations when scanning for changes). The new advanced folder option `caseSensitiveFS` can be used to disable the safety checks, retaining the previous behavior on systems known to be fully case sensitive. Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
committed by
Jakob Borg
co-authored by
Jakob Borg
parent
21dd9d6b43
commit
932d8c69de
@@ -131,8 +131,10 @@ func copyFileContents(method fs.CopyRangeMethod, srcFs, dstFs fs.Filesystem, src
|
||||
}
|
||||
|
||||
func IsDeleted(ffs fs.Filesystem, name string) bool {
|
||||
if _, err := ffs.Lstat(name); fs.IsNotExist(err) {
|
||||
return true
|
||||
if _, err := ffs.Lstat(name); err != nil {
|
||||
if fs.IsNotExist(err) || fs.IsErrCaseConflict(err) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
switch TraversesSymlink(ffs, filepath.Dir(name)).(type) {
|
||||
case *NotADirectoryError, *TraversesSymlinkError:
|
||||
|
||||
Reference in New Issue
Block a user