Repository navigation
Conversation
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
e7c27f1 to
c637b91
Compare
| // skipped update still counts as a destination for hard-link preservation. | ||
| if dest_metadata.is_dir() && !options.dereference(source_in_command_line) && source.is_symlink() | ||
| { | ||
| if options.copy_mode == CopyMode::Update |
There was a problem hiding this comment.
this update branch isn't tested, could you please add a -au / --update=older case?
| return Err(CpError::Skipped(false)); | ||
| } | ||
| if options.backup != BackupMode::None { | ||
| if options.copy_mode == CopyMode::Link { |
There was a problem hiding this comment.
same for the --link --backup path, please add a test
| } | ||
|
|
||
| /// Decide whether an existing destination should be updated. | ||
| fn should_update(source_metadata: &Metadata, dest: &Path, options: &Options) -> CopyResult<bool> { |
There was a problem hiding this comment.
moving the update logic out of handle_copy_mode is a refactor on its own, please split it into a separate pr
| at.mkdir("srcdir"); | ||
| at.touch("srcdir/real.txt"); | ||
| symlink("real.txt", at.plus("srcdir/link.txt")).unwrap(); | ||
| // An external target tests dereferencing without requiring hard-link support. |
There was a problem hiding this comment.
why change these existing tests? does -aL now fail when the hard link can't be created?
|
|
||
| #[rstest] | ||
| #[case::archive("-a")] | ||
| #[case::with_backup("-ab")] |
There was a problem hiding this comment.
please add a case with -L too, to make sure the deref path still succeeds
|
thanks for the patch! |
c637b91 to
75fb3d0
Compare
75fb3d0 to
54ce907
Compare
54ce907 to
60652b3
Compare
Report the failed symlink copy and exit with status 1. Preserve the existing directory and its backup, and continue copying the remaining entries.
Closes #17001.