Skip to content

Commit 684fe22

Browse files
Merge pull request sebastianbergmann#10 from adrianclay/empty-line-fix
Make the type optional when parsing chunk lines.
2 parents 10a9cd9 + e072794 commit 684fe22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function parseFileDiff(Diff $diff, array $lines)
110110
$last = null;
111111

112112
while (count($lines) &&
113-
(preg_match('(^(?P<type>[+ -])(?P<line>.*))', $last = array_shift($lines), $match) ||
113+
(preg_match('(^(?P<type>[+ -])?(?P<line>.*))', $last = array_shift($lines), $match) ||
114114
(strpos($last, '\\ No newline at end of file' ) === 0))) {
115115
if (count($match)) {
116116
$type = Line::UNCHANGED;

0 commit comments

Comments
 (0)