mv should error when attempting to move folders into itself #13082
Closed
Description
Describe the bug
mv
will happily execute the following, and not return any error of it being unexpected or nonsensical. This can end up with confusing results where the folder just disappears.
How to reproduce
mkdir a
mv a a/a
Expected behavior
Something similar to zsh
:
mkdir a
mv a a/a
mv: rename a to a/a: Invalid argument
Screenshots
No response
Configuration
key | value |
---|---|
version | 0.93.0 |
major | 0 |
minor | 93 |
patch | 0 |
branch | |
commit_hash | |
build_os | macos-aarch64 |
build_target | aarch64-apple-darwin |
rust_version | rustc 1.77.2 (25ef9e3d8 2024-04-09) (built from a source tarball) |
cargo_version | cargo 1.77.1 |
build_time | 1980-01-01 00:00:00 +00:00 |
build_rust_channel | release |
allocator | mimalloc |
features | default, sqlite, system-clipboard, trash, which |
installed_plugins | polars |
Additional context
No response