mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
Merge pull request #4272 from cakebaker/mv_remove_unnecessary_not
mv: remove unnecessary "!"
This commit is contained in:
commit
22821c8ac6
1 changed files with 3 additions and 3 deletions
|
@ -284,12 +284,12 @@ fn exec(files: &[OsString], b: &Behavior) -> UResult<()> {
|
|||
|
||||
if target.is_dir() {
|
||||
if b.no_target_dir {
|
||||
if !source.is_dir() {
|
||||
Err(MvError::DirectoryToNonDirectory(target.quote().to_string()).into())
|
||||
} else {
|
||||
if source.is_dir() {
|
||||
rename(source, target, b, None).map_err_context(|| {
|
||||
format!("cannot move {} to {}", source.quote(), target.quote())
|
||||
})
|
||||
} else {
|
||||
Err(MvError::DirectoryToNonDirectory(target.quote().to_string()).into())
|
||||
}
|
||||
} else {
|
||||
move_files_into_dir(&[source.clone()], target, b)
|
||||
|
|
Loading…
Reference in a new issue