mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
cp: debug with --update=none should show 'skipped'
This commit is contained in:
parent
6b1f51385f
commit
8685e05f4e
2 changed files with 22 additions and 1 deletions
|
@ -1815,7 +1815,13 @@ fn copy_file(
|
|||
symlinked_files,
|
||||
)?;
|
||||
}
|
||||
update_control::UpdateMode::ReplaceNone => return Ok(()),
|
||||
update_control::UpdateMode::ReplaceNone => {
|
||||
if options.debug {
|
||||
println!("skipped {}", dest.quote());
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
update_control::UpdateMode::ReplaceIfOlder => {
|
||||
let dest_metadata = fs::symlink_metadata(dest)?;
|
||||
|
||||
|
|
|
@ -3367,6 +3367,21 @@ fn test_cp_debug_sparse_reflink() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_debug_no_update() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
at.touch("a");
|
||||
at.touch("b");
|
||||
ts.ucmd()
|
||||
.arg("--debug")
|
||||
.arg("--update=none")
|
||||
.arg("a")
|
||||
.arg("b")
|
||||
.succeeds()
|
||||
.stdout_contains("skipped 'b'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn test_cp_debug_sparse_always() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue