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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user