Skip to content

Commit

Permalink
Merge pull request #5143 from cakebaker/mv_remove_unnecessary_or
Browse files Browse the repository at this point in the history
mv: remove unnecessary OR in condition
  • Loading branch information
tertsdiepraam committed Aug 10, 2023
2 parents a8b6e50 + 09360e6 commit 268292f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/uu/mv/src/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,7 @@ fn rename(
let mut backup_path = None;

if to.exists() {
if (b.update == UpdateMode::ReplaceIfOlder || b.update == UpdateMode::ReplaceNone)
&& b.overwrite == OverwriteMode::Interactive
{
if b.update == UpdateMode::ReplaceIfOlder && b.overwrite == OverwriteMode::Interactive {
// `mv -i --update old new` when `new` exists doesn't move anything
// and exit with 0
return Ok(());
Expand Down

0 comments on commit 268292f

Please sign in to comment.