mirror of
https://github.com/rclone/rclone.git
synced 2026-10-28 14:28:38 -04:00
operations: fix case- or Unicode-only renames deleting the file
Before this change, on backends without server-side `Move`, renaming a file to an equivalent name deleted it: a name differing only in case on a case-insensitive backend, or only in Unicode normalization on a backend such as Cloudflare R2, which treats NFC and NFD names as equivalent. `operations.move` fell back to copying the file to the new name and then deleting the source, but both resolved to the same object, so the delete removed the file it just copied. This affected `--fix-case` renames in `sync` and `bisync`, `--track-renames` with `--no-unicode-normalization`, and renames through the VFS (`rclone mount`, `rclone serve`). `MoveFile` and backends with server-side `Move` already handled these renames by moving through a temporary name. After this change, the copy-and-delete fallback also moves through a temporary name when the two names are equivalent. The issue was discovered on the bisync integration tests.
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f