Removing package for re-install and re-patch does not trigger if patches definition is empty (1.7.3) #525
Closed
5 tasks done
Labels
bug
Inconsistencies or issues which will cause a problem for users or implementors.
Verification
composer self-update
)composer update cweagans/composer-patches
)What were you trying to do (and why)?
This is using composer-patches 1.7.3
Removing and re-installing patched modules does not behave correctly when no patches are provided in the
composer.json
or external patches JSON file.For example, assuming the following starting state, the below patches have been applied:
If the user wants to remove both
mock-patch-1
andmock-patch-2
, and do so by modifying the JSON to the following:{ "patches": {} }
Then running
composer install
, the previously applied patches would not be removed and the output would be as follows:This differs from expected behavior, for example if we were instead removing only
mock-patch-2
the following JSON could be provided:Running
composer install
now would re-installacme/module-2
and removemock-patch-2
, and the output would be as follows:The expectation is this same process would be applied to an empty
patches
definition too. I believe, but haven't verified that this did used to be the case.I have worked around this issue temporarily by providing fake empty patch in my patches JSON that targets a non-existent module which appears to have the desired behavior.
What happened? What did you expect to happen?
Expected
composer install
to re-install previously patched modules, restoring them to the un-patched state.composer install
returned "no patches supplied" but did not re-install modules that were previously patched. Previously applied patches remained in place.The text was updated successfully, but these errors were encountered: