Skip to content

Commit 09f8e92

Browse files
Axel Rutzlkmorlan
authored andcommitted
Make rewrite() and rollback() exact inverses
1 parent b1354d6 commit 09f8e92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Writer/Drupal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public function rewrite($version, $timestamp, $core = null, $project = null)
5353
*/
5454
public function rollback()
5555
{
56-
$pattern = '# Information added by drupal-composer/info-rewrite; date of revision:';
56+
$pattern = "\n# Information added by drupal-composer/info-rewrite; date of revision:";
5757
foreach ($this->paths as $info_file) {
5858
$contents = file_get_contents($info_file);
5959
$parts = explode($pattern, $contents);
60-
file_put_contents($info_file, trim($parts[0]) . "\n");
60+
file_put_contents($info_file, $parts[0]);
6161
}
6262
}
6363

0 commit comments

Comments
 (0)