diff --git a/crates/nu-command/src/filesystem/ucp.rs b/crates/nu-command/src/filesystem/ucp.rs index b100a23bff..40315d9e78 100644 --- a/crates/nu-command/src/filesystem/ucp.rs +++ b/crates/nu-command/src/filesystem/ucp.rs @@ -142,19 +142,9 @@ impl Command for UCp { } else { uu_cp::OverwriteMode::Clobber(uu_cp::ClobberMode::Standard) }; - #[cfg(any( - target_os = "linux", - target_os = "freebsd", - target_os = "android", - target_os = "macos" - ))] + #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))] let reflink_mode = uu_cp::ReflinkMode::Auto; - #[cfg(not(any( - target_os = "linux", - target_os = "freebsd", - target_os = "android", - target_os = "macos" - )))] + #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "macos")))] let reflink_mode = uu_cp::ReflinkMode::Never; let mut paths = call.rest::>(engine_state, stack, 0)?; if paths.is_empty() { diff --git a/crates/nu-command/tests/commands/ucp.rs b/crates/nu-command/tests/commands/ucp.rs index 7834e91e7c..fe18d9187d 100644 --- a/crates/nu-command/tests/commands/ucp.rs +++ b/crates/nu-command/tests/commands/ucp.rs @@ -894,13 +894,19 @@ fn test_cp_debug_default() { { panic!("{}", format!("Failure: stdout was \n{}", actual.out)); } - #[cfg(any(target_os = "linux", target_os = "freebsd"))] + #[cfg(target_os = "linux")] if !actual .out .contains("copy offload: yes, reflink: unsupported, sparse detection: no") { panic!("{}", format!("Failure: stdout was \n{}", actual.out)); } + #[cfg(target_os = "freebsd")] + if !actual.out.contains( + "copy offload: unsupported, reflink: unsupported, sparse detection: unsupported", + ) { + panic!("{}", format!("Failure: stdout was \n{}", actual.out)); + } #[cfg(windows)] if !actual.out.contains(