diff --git a/src/Gitonomy/Git/Parser/CommitParser.php b/src/Gitonomy/Git/Parser/CommitParser.php index 58b9713..6fff1ea 100644 --- a/src/Gitonomy/Git/Parser/CommitParser.php +++ b/src/Gitonomy/Git/Parser/CommitParser.php @@ -47,6 +47,8 @@ protected function doParse() list($this->committerName, $this->committerEmail, $committerDate) = $this->consumeNameEmailDate(); $this->committerDate = $this->parseDate($committerDate); + $this->consumeMergeTag(); + // will consume an GPG signed commit if there is one $this->consumeGPGSignature(); diff --git a/src/Gitonomy/Git/Parser/LogParser.php b/src/Gitonomy/Git/Parser/LogParser.php index ad41ce4..53e5b16 100644 --- a/src/Gitonomy/Git/Parser/LogParser.php +++ b/src/Gitonomy/Git/Parser/LogParser.php @@ -45,6 +45,8 @@ protected function doParse() list($commit['committerName'], $commit['committerEmail'], $committerDate) = $this->consumeNameEmailDate(); $commit['committerDate'] = $this->parseDate($committerDate); + $this->consumeMergeTag(); + // will consume an GPG signed commit if there is one $this->consumeGPGSignature(); diff --git a/src/Gitonomy/Git/Parser/ParserBase.php b/src/Gitonomy/Git/Parser/ParserBase.php index 7cd37e7..be149bf 100644 --- a/src/Gitonomy/Git/Parser/ParserBase.php +++ b/src/Gitonomy/Git/Parser/ParserBase.php @@ -136,4 +136,18 @@ protected function consumeGPGSignature() return $this->consumeTo("\n\n"); } + + protected function consumeMergeTag() + { + $expected = "\nmergetag "; + $length = strlen($expected); + $actual = substr($this->content, $this->cursor, $length); + if ($actual != $expected) { + return ''; + } + $this->cursor += $length; + + $this->consumeTo('-----END PGP SIGNATURE-----'); + $this->consume('-----END PGP SIGNATURE-----'); + } }