diff --git a/src/Gitonomy/Git/Parser/CommitParser.php b/src/Gitonomy/Git/Parser/CommitParser.php index 804fc1f..eba71e4 100644 --- a/src/Gitonomy/Git/Parser/CommitParser.php +++ b/src/Gitonomy/Git/Parser/CommitParser.php @@ -45,6 +45,10 @@ protected function doParse() $this->consume('committer '); list($this->committerName, $this->committerEmail, $this->committerDate) = $this->consumeNameEmailDate(); $this->committerDate = $this->parseDate($this->committerDate); + + // will consume an GPG signed commit if there is one + $this->consumeGPGSignature(); + $this->consumeNewLine(); $this->consumeNewLine(); diff --git a/tests/Gitonomy/Git/Tests/CommitTest.php b/tests/Gitonomy/Git/Tests/CommitTest.php index 84b0206..8a7c2c6 100644 --- a/tests/Gitonomy/Git/Tests/CommitTest.php +++ b/tests/Gitonomy/Git/Tests/CommitTest.php @@ -185,6 +185,18 @@ public function testGetMessage($repository) $this->assertEquals('add a long file'."\n", $commit->getMessage()); } + /** + * This test ensures that GPG signed commits does not break the reading of a commit + * message. + * + * @dataProvider provideFoobar + */ + public function testGetSignedMessage($repository) + { + $commit = $repository->getCommit(self::SIGNED_COMMIT); + $this->assertEquals('signed commit'."\n", $commit->getMessage()); + } + /** * @dataProvider provideFoobar */