Skip to content

Commit e8fe207

Browse files
Merge pull request #133 from jezzacoder/master
Fixed issue with LogParser unable to parse commit with no message
2 parents ba09331 + 7d922f8 commit e8fe207

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Gitonomy/Git/Parser/LogParser.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ protected function doParse()
5151
$this->consumeNewLine();
5252

5353
$message = '';
54-
while ($this->expects(' ')) {
55-
$message .= $this->consumeTo("\n")."\n";
56-
$this->consumeNewLine();
54+
if ($this->expects(' ')) {
55+
$this->cursor -= strlen(' ');
56+
57+
while ($this->expects(' ')) {
58+
$message .= $this->consumeTo("\n")."\n";
59+
$this->consumeNewLine();
60+
}
61+
}
62+
else {
63+
$this->cursor--;
5764
}
5865

5966
if (!$this->isFinished()) {

0 commit comments

Comments
 (0)