mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Fix principal error in makeChangesWithContext()
Summary: `array_fill()`, contrary to `range()`, doesn't accept the last element but the number of elements. Test Plan: Reparsed commit not changed after the last diff but rebased which was previously reported as changed. Reviewers: jungejason, epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2783
This commit is contained in:
parent
e84f9f9ec9
commit
656c82f9b8
1 changed files with 1 additions and 1 deletions
|
@ -142,7 +142,7 @@ final class DifferentialChangeset extends DifferentialDAO {
|
||||||
$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] == '-') {
|
if ($line[0] == '+' || $line[0] == '-') {
|
||||||
$context += array_fill($l - $num_lines, $l + $num_lines, true);
|
$context += array_fill($l - $num_lines, 2 * $num_lines + 1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$with_context[] = array_intersect_key($changes, $context);
|
$with_context[] = array_intersect_key($changes, $context);
|
||||||
|
|
Loading…
Reference in a new issue