Skip to content

Commit

Permalink
minor #110 Fix GPG signed commits will break on reading full commit m…
Browse files Browse the repository at this point in the history
…essage (stojg)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Fix GPG signed commits will break on reading full commit message

Ensure that we can get the full message when the commit has been GPG signed

Follow up on #109 that only deals with the "log" part, this ensure that we can also return the message.

Commits
-------

02de6db Fix GPG signed commits will break on reading full commit message
  • Loading branch information
lyrixx committed May 11, 2016
2 parents 37ad030 + 02de6db commit b4b9164
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Gitonomy/Git/Parser/CommitParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 12 additions & 0 deletions tests/Gitonomy/Git/Tests/CommitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit b4b9164

Please sign in to comment.