sync: --fix-case flag to rename case insensitive dest - fixes #4854

Before this change, a sync to a case insensitive dest (such as macOS / Windows)
would not result in a matching filename if the source and dest had casing
differences but were otherwise equal. For example, syncing `hello.txt` to
`HELLO.txt` would result in the dest filename remaining `HELLO.txt`.
Furthermore, `--local-case-sensitive` did not solve this, as it actually caused
`HELLO.txt` to get deleted!

After this change, `HELLO.txt` is renamed to `hello.txt` to match the source,
only if the `--fix-case` flag is specified. (The old behavior remains the
default.)
This commit is contained in:
nielash
2023-10-08 22:59:22 -04:00
parent 88e516adee
commit 11afc3dde0
5 changed files with 91 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ type ConfigInfo struct {
IgnoreSize bool
IgnoreChecksum bool
IgnoreCaseSync bool
FixCase bool
NoTraverse bool
CheckFirst bool
NoCheckDest bool