Changeset View
Changeset View
Standalone View
Standalone View
src/parser/diff/ArcanistDiffChange.php
Context not available. | |||||
$new = $hunk->getNewOffset(); | $new = $hunk->getNewOffset(); | ||||
$olds = array(); | $olds = array(); | ||||
$news = array(); | $news = array(); | ||||
$lines = explode("\n", $hunk->getCorpus()); | $lines = @explode("\n", $hunk->getCorpus()); | ||||
foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
$type = substr($line, 0, 1); | $type = @substr($line, 0, 1); | ||||
if ($type == '-' || $type == ' ') { | if ($type == '-' || $type == ' ') { | ||||
$olds[] = $old; | $olds[] = $old; | ||||
$old++; | $old++; | ||||
Context not available. | |||||
$hunk = reset($hunks); | $hunk = reset($hunks); | ||||
$corpus = $hunk->getCorpus(); | $corpus = $hunk->getCorpus(); | ||||
$match = null; | $match = null; | ||||
if (!preg_match('/^\+(?:link )?(.*)$/m', $corpus, $match)) { | if (!@preg_match('/^\+(?:link )?(.*)$/m', $corpus, $match)) { | ||||
throw new Exception(pht('Failed to extract link target!')); | throw new Exception(pht('Failed to extract link target!')); | ||||
} | } | ||||
return trim($match[1]); | return trim($match[1]); | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0