Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mv: add OverwriteMode match in specific case #3383

Merged
merged 2 commits into from Apr 12, 2022
Merged

mv: add OverwriteMode match in specific case #3383

merged 2 commits into from Apr 12, 2022

Conversation

ghost
Copy link

@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
Contributor

Could you please add a test? Thanks

@ghost
Copy link
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
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
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
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