Skip to content

Commit 65c7e8e

Browse files
committed
Fixing missing blank line at end of modified patch files
1 parent 90ee9dd commit 65c7e8e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Update/DiffHelper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public static function removeFilesFromPatch(string $patch, array $files, array &
3535
$patch = $contentBefore.substr($patch, $end);
3636
}
3737

38+
// valid patches end with a blank line
39+
if ($patch && "\n" !== substr($patch, \strlen($patch) - 1, 1)) {
40+
$patch = $patch."\n";
41+
}
42+
3843
return $patch;
3944
}
4045
}

tests/Update/DiffHelperTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function getRemoveFilesFromPatchTests(): iterable
105105
+ dbal:
106106
+ # "TEST_TOKEN" is typically set by ParaTest
107107
+ dbname_suffix: '_test%env(default::TEST_TOKEN)%'
108+
108109
EOF
109110
, [
110111
'.env' => <<<EOF
@@ -154,6 +155,7 @@ public function getRemoveFilesFromPatchTests(): iterable
154155
+ dbal:
155156
+ # "TEST_TOKEN" is typically set by ParaTest
156157
+ dbname_suffix: '_test%env(default::TEST_TOKEN)%'
158+
157159
EOF
158160
, [
159161
'config/packages/doctrine.yaml' => <<<EOF
@@ -204,6 +206,7 @@ public function getRemoveFilesFromPatchTests(): iterable
204206
- type: pool
205207
- pool: doctrine.system_cache_pool
206208
query_cache_driver:
209+
207210
EOF
208211
, [
209212
'config/packages/test/doctrine.yaml' => <<<EOF
@@ -244,6 +247,7 @@ public function getRemoveFilesFromPatchTests(): iterable
244247
- type: pool
245248
- pool: doctrine.system_cache_pool
246249
query_cache_driver:
250+
247251
EOF
248252
, [
249253
'config/packages/test/doctrine.yaml' => <<<EOF

0 commit comments

Comments
 (0)