* mv: implement hardlink support
Should fix GNU tests/mv/part-hardlink.sh tests/mv/hard-link-1.sh
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* mv: fix the GNU test - tests/mv/part-fail
* make it pass on windows
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* Fix linting and style issues
* Change condition to not fail for dangling symlinks
The function `move_files_into_dir` had a condition that failed when a
dangling symlink was moved into a folder, which resulted in a file
or directory doesn't exist error
* Added a test case
Fix a bug in `mv` where it would hang indefinitely while trying to copy
a FIFO across filesystems. The solution is to remove the old FIFO and
create a new one on the new filesystem.
Fixes#7076
- 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
```
Causing: https://github.com/nushell/nushell/issues/13082
* uucore: add update control `none-fail`
* uucore: show suggestion when parse errors occurs because of an ambiguous value
* added tests for fail-none and ambiguous parse error
* uucore: ambiguous value code refractor
* cp: no-clobber fail silently and outputs skipped message in debug
* mv: add --debug support
* minor changes
---------
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
* mv: inter partition copying test code cleanup
* mv: inter partition copying use of read_to_string and write
* Update tests/by-util/test_mv.rs
Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
---------
Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
The test_cp and test_mv have xattr related tests. They should
be disabled on OpenBSD after commit 19d42c0339 disabled the
compare_xattrs function on OpenBSD.
Fixes#6348
* Add tests mv file into dir and dir into file where both are files
* Fix test_mv_dir_into_file_where_both_are_files
* Fix test_mv_file_into_dir_where_both_are_files
* Store String in error instead of PathBuf
* Implement path_ends_with_terminator for windows
* Fix compilation on windows
* mv: moving directory itself should fail
* mv: Check trailing slash also fails on target containing itself
* mv: add "spell-checker:ignore mydir" to test
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>