1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Handle empty lines in makeChangesWithContext()

Summary: Happens on the end of hunk.

Test Plan:
  $ ./reparse.php

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4091
This commit is contained in:
vrana 2012-12-06 07:52:33 -08:00
parent 2852b4f5d3
commit 86470e7a30

View file

@ -137,7 +137,8 @@ final class DifferentialChangeset extends DifferentialDAO {
$context = array();
$changes = explode("\n", $hunk->getChanges());
foreach ($changes as $l => $line) {
if ($line[0] == '+' || $line[0] == '-') {
$type = substr($line, 0, 1);
if ($type == '+' || $type == '-') {
$context += array_fill($l - $num_lines, 2 * $num_lines + 1, true);
}
}