Skip to content

mv: add OverwriteMode match in specific case#3383

Merged
sylvestre merged 2 commits intomainfrom
unknown repository
Apr 12, 2022
Merged

mv: add OverwriteMode match in specific case#3383
sylvestre merged 2 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 10, 2022

Check OverwriteMode and act depending on its value, specifically in the
the case of overwriting a non-directory with a directory
fixes #3337

@sylvestre
Copy link
Copy Markdown
Contributor

Could you please add a test? Thanks

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 11, 2022

Could you please add a test? Thanks

I added an assert within the mv_errors test

Ashe Leclerc added 2 commits April 12, 2022 09:28
Check OverwriteMode and act depending on its value, specifically in the
the case of overwriting a non-directory with a directory(#3337)
test -i flag in case of overwriting a non-directory with a directory
@sylvestre
Copy link
Copy Markdown
Contributor

2022-04-12T08:49:30.2256259Z PASS: tests/mv/i-5.sh
\o/

// $ at.mkdir dir && at.touch file
// $ mv -i dir file
// err == mv: cannot overwrite non-directory 'file' with directory 'dir'
assert!(!scene
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please create a separate new test for this?
easier to debug / identify regression

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it instead :)

@sylvestre sylvestre merged commit 0f59af2 into uutils:main Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mv/i-5.sh: interactive question isn't prompted

1 participant