diff --git a/src/Phing/Task/Ext/Git/GitDescribeTask.php b/src/Phing/Task/Ext/Git/GitDescribeTask.php index a075280ff..22fa0685b 100644 --- a/src/Phing/Task/Ext/Git/GitDescribeTask.php +++ b/src/Phing/Task/Ext/Git/GitDescribeTask.php @@ -140,7 +140,7 @@ public function main() } if (null !== $this->outputProperty) { - $this->project->setProperty($this->outputProperty, $output); + $this->project->setProperty($this->outputProperty, trim($output)); } $this->log( diff --git a/src/Phing/Task/Ext/Git/GitTagTask.php b/src/Phing/Task/Ext/Git/GitTagTask.php index b4c4ed026..40b378ffa 100644 --- a/src/Phing/Task/Ext/Git/GitTagTask.php +++ b/src/Phing/Task/Ext/Git/GitTagTask.php @@ -222,7 +222,7 @@ public function main() } if (null !== $this->outputProperty) { - $this->project->setProperty($this->outputProperty, $output); + $this->project->setProperty($this->outputProperty, trim($output)); } $this->log( diff --git a/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php index eb253c69b..c65d19b3f 100644 --- a/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php +++ b/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php @@ -137,7 +137,7 @@ public function testTagOutputPropertySet(): void $this->assertInLogs('git-tag command: LC_ALL=C && git tag \'marked\''); $this->assertInLogs('git-tag command: LC_ALL=C && git tag -l \'marked\''); $this->assertInLogs('git-tag output: marked'); - $this->assertPropertyEquals('gitLogOutput', 'marked' . "\n"); + $this->assertPropertyEquals('gitLogOutput', 'marked'); } public function testTagWithCommitSet(): void