-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mv: improve move-to-self error handling #6995
Conversation
b0ef406
to
5af8055
Compare
GNU testsuite comparison:
|
7f5d2d2
to
c983180
Compare
GNU testsuite comparison:
|
c983180
to
2425ccc
Compare
GNU testsuite comparison:
|
3ce0134
to
ddbb07b
Compare
GNU testsuite comparison:
|
ddbb07b
to
f104ba0
Compare
GNU testsuite comparison:
|
is there a bug somewhere or it is just something you identified ? |
) -> UResult<()> { | ||
let target_is_dir = target_is_dir && !opts.no_target_dir; | ||
|
||
let canonicalized_source = match canonicalize( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please add some comments explaining the different cases ?
e2c722d
to
a163c2b
Compare
nushell users reported the data loss that got me working on this: nushell/nushell#13082 |
- improve move-to-self detection, so this errors without data loss: ```diff mkdir mydir mv mydir mydir/subdir -mv: No such file or directory (os error 2) +mv: cannot move 'mydir' to a subdirectory of itself, 'mydir/subdir' ``` - align "cannot move source to a subdirectory of itself" and "same file" errors more closely with coreutils: ```diff mkdir mydir mv mydir/ mydir/.. -mv: cannot move 'mydir/' to a subdirectory of itself, 'mydir/../mydir/' +mv: 'mydir/' and 'mydir/../mydir' are the same file ```
a163c2b
to
b60befe
Compare
GNU testsuite comparison:
|
excellent, thanks! |
That would be greatly appreciated! |
errors more closely with coreutils: