Commit c0c28f8
committed
bug #885 fix: Recipe update skip ignored files (maxime-aknin, Max)
This PR was squashed before being merged into the 1.x branch.
Discussion
----------
fix: Recipe update skip ignored files
I ran into an issue with the `composer recipes:update` command. While trying to update `doctrine/doctrine-bundle` recipe from 2.0 to 2.4, the command ouput stated that the recipe was updated with conflicts, but there were no actual changes made in files (except the symfony lock file):

What's happening is that this recipe update contains changes that are applied to `phpunit.xml` by ` Symfony\Flex\Configurator\EnvConfigurator`, but this file is also added to `gitignore` by `phpunit/phpunit` [recipe](https://github.com/symfony/recipes/blob/2d1ba2cf32556d9c01ff7bd05bb02ec9bfb44e5c/phpunit/phpunit/9.3/manifest.json#L8)
The fact that there is an ignored file in the recipe patch makes the `git apply` command in [RecipePatcher](https://github.com/symfony/flex/blob/b66b0dd8f5099002f4863aa0bba0c3e0c9e8523b/src/Update/RecipePatcher.php#L55) fail without applying the patch, and this failure is not detected by the rest of the function.

My proposal is to filter out ignored files from the beginning of the `generatePatch` function to fix this issue.
Commits
-------
cba1b4a fix: Recipe update skip ignored filesFile tree
2 files changed
+41
-6
lines changed- src/Update
- tests/Update
2 files changed
+41
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
243 | 255 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
46 | 58 | | |
47 | 59 | | |
48 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
49 | 66 | | |
50 | 67 | | |
51 | 68 | | |
| |||
158 | 175 | | |
159 | 176 | | |
160 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
161 | 184 | | |
162 | 185 | | |
163 | 186 | | |
| |||
0 commit comments