Closed Xerxes-2 closed 3 months ago
There's an unexpected behavior: when i rename a file to it's hardlink, it will overwrite (same as being deleted) without asking. Before this PR, yazi would ask whether to Overwrite an existing file.
reproduce:
touch 1
ln 1 2
./yazi
(rename 2 to 1)
There's an unexpected behavior: when i rename a file to it's hardlink, it will overwrite (same as being deleted) without asking. Before this PR, yazi would ask whether to Overwrite an existing file.
reproduce:
touch 1 ln 1 2 ./yazi (rename 2 to 1)
I think new commit have resolved this issue, but in a slight dumb approach.
Thanks for the PR, I'll take care of the follow-up work on this.
Original issue here: https://github.com/sxyazi/yazi/issues/1171
Fixes https://github.com/sxyazi/yazi/issues/1171
This PR introduced a function
are_paths_equal
infns.rs
to determine if two paths points to the same node. It fixes the rename and bulk_rename functions not working properly when only change the case of letters. Previously these functions only check if the new path already exists, but not considering the old and new path could be the same node in case-insensitive systems like macOS and Windows.