Skip to content

Commit 02de6db

Browse files
author
Stig Lindqvist
committed
Fix GPG signed commits will break on reading full commit message
1 parent 37ad030 commit 02de6db

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Gitonomy/Git/Parser/CommitParser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ protected function doParse()
4545
$this->consume('committer ');
4646
list($this->committerName, $this->committerEmail, $this->committerDate) = $this->consumeNameEmailDate();
4747
$this->committerDate = $this->parseDate($this->committerDate);
48+
49+
// will consume an GPG signed commit if there is one
50+
$this->consumeGPGSignature();
51+
4852
$this->consumeNewLine();
4953

5054
$this->consumeNewLine();

tests/Gitonomy/Git/Tests/CommitTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ public function testGetMessage($repository)
185185
$this->assertEquals('add a long file'."\n", $commit->getMessage());
186186
}
187187

188+
/**
189+
* This test ensures that GPG signed commits does not break the reading of a commit
190+
* message.
191+
*
192+
* @dataProvider provideFoobar
193+
*/
194+
public function testGetSignedMessage($repository)
195+
{
196+
$commit = $repository->getCommit(self::SIGNED_COMMIT);
197+
$this->assertEquals('signed commit'."\n", $commit->getMessage());
198+
}
199+
188200
/**
189201
* @dataProvider provideFoobar
190202
*/

0 commit comments

Comments
 (0)