mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 04:31:13 +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:
parent
2852b4f5d3
commit
86470e7a30
1 changed files with 2 additions and 1 deletions
|
@ -137,7 +137,8 @@ final class DifferentialChangeset extends DifferentialDAO {
|
||||||
$context = array();
|
$context = array();
|
||||||
$changes = explode("\n", $hunk->getChanges());
|
$changes = explode("\n", $hunk->getChanges());
|
||||||
foreach ($changes as $l => $line) {
|
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);
|
$context += array_fill($l - $num_lines, 2 * $num_lines + 1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue