-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[filesystem] handle copying when source and target destinations are the same #4813
Conversation
@kittaakos Could you review it please? |
@vince-fugnitto, test this, please. I think it would be better to throw an error, instead of silently return with the source.
Thoughts? |
Sure, I can throw an error instead! |
We would need to check that all clients expect it and handle properly. Do you expect that client should do something special with such error or they would just ignore? If ignore maybe return silently is not a bad option, less code for clients or errors in logs. |
I was thinking silent would be enough since the error would most likely be ignored. |
That's my problem, if you are copying something to the same destination, then something was already wrong. So I want to see an error, instead of ignoring it. |
911e895
to
947f559
Compare
@kittaakos updated! |
Please add a test. |
Fixes #4812 - Fixes an issue when calling `copy` from the filesystem when the `source` and `target` destinations are the same. Currently, no check is performed to verify if the paths are different which leads to `fs-extra` throwing an error. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
947f559
to
b08535a
Compare
Done! |
@kittaakos are you fine with the latest changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works as expected; thank you for the patch! 👍
thank you @kittaakos ! |
Fixes #4812
copy
from the filesystem whenthe
source
andtarget
destinations are the same. Currently,no check is performed to verify if the paths are different
which leads to
fs-extra
throwing an error.Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com