diff --git a/dev/src/uu_mv/mv.rs.html b/dev/src/uu_mv/mv.rs.html index 4a7e65d8f..9171cc25d 100644 --- a/dev/src/uu_mv/mv.rs.html +++ b/dev/src/uu_mv/mv.rs.html @@ -617,6 +617,8 @@ 617 618 619 +620 +621
// This file is part of the uutils coreutils package.
//
// (c) Orvar Segerström <orvarsegerstrom@gmail.com>
@@ -644,7 +646,7 @@
use uucore::backup_control::{self, BackupMode};
use uucore::display::Quotable;
use uucore::error::{set_exit_code, FromIo, UError, UResult, USimpleError, UUsageError};
-use uucore::fs::are_hardlinks_or_one_way_symlink_to_same_file;
+use uucore::fs::{are_hardlinks_or_one_way_symlink_to_same_file, are_hardlinks_to_same_file};
use uucore::update_control::{self, UpdateMode};
use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show};
@@ -874,8 +876,10 @@
return Err(MvError::NoSuchFile(source.quote().to_string()).into());
}
- if (source.eq(target) || are_hardlinks_or_one_way_symlink_to_same_file(source, target))
- && b.backup != BackupMode::SimpleBackup
+ if (source.eq(target)
+ || are_hardlinks_to_same_file(source, target)
+ || are_hardlinks_or_one_way_symlink_to_same_file(source, target))
+ && b.backup == BackupMode::NoBackup
{
if source.eq(Path::new(".")) || source.ends_with("/.") || source.is_file() {
return Err(
diff --git a/dev/src/uucore/features/fs.rs.html b/dev/src/uucore/features/fs.rs.html
index f65d401f5..7e1d9623b 100644
--- a/dev/src/uucore/features/fs.rs.html
+++ b/dev/src/uucore/features/fs.rs.html
@@ -1510,12 +1510,12 @@
/// * `bool` - Returns `true` if the paths are hard links to the same file, and `false` otherwise.
#[cfg(unix)]
pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool {
- let source_metadata = match fs::metadata(source) {
+ let source_metadata = match fs::symlink_metadata(source) {
Ok(metadata) => metadata,
Err(_) => return false,
};
- let target_metadata = match fs::metadata(target) {
+ let target_metadata = match fs::symlink_metadata(target) {
Ok(metadata) => metadata,
Err(_) => return false,
};
diff --git a/dev/uu_mv/index.html b/dev/uu_mv/index.html
index 344eb2ade..ea25ae646 100644
--- a/dev/uu_mv/index.html
+++ b/dev/uu_mv/index.html
@@ -1 +1 @@
-uu_mv - Rust
\ No newline at end of file
+uu_mv - Rust
\ No newline at end of file