Changeset View
Changeset View
Standalone View
Standalone View
src/parser/ArcanistDiffParser.php
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | do { | ||||
if (!$ok && $this->isFirstNonEmptyLine()) { | if (!$ok && $this->isFirstNonEmptyLine()) { | ||||
// 'hg export' command creates so called "extended diff" that | // 'hg export' command creates so called "extended diff" that | ||||
// contains some meta information and comment at the beginning | // contains some meta information and comment at the beginning | ||||
// (isFirstNonEmptyLine() to check for beginning). Actual mercurial | // (isFirstNonEmptyLine() to check for beginning). Actual mercurial | ||||
// code detects where comment ends and unified diff starts by | // code detects where comment ends and unified diff starts by | ||||
// searching for "diff -r" or "diff --git" in the text. | // searching for "diff -r" or "diff --git" in the text. | ||||
$this->saveLine(); | $this->saveLine(); | ||||
$line = $this->nextLineThatLooksLikeDiffStart(); | $line = $this->nextLineThatLooksLikeDiffStart(); | ||||
if (!$this->tryMatchHeader($patterns, $line, $match)) { | if (!phutil_nonempty_string($line)) { | ||||
$failed_parse = true; | |||||
} else if (!$this->tryMatchHeader($patterns, $line, $match)) { | |||||
// Restore line before guessing to display correct error. | // Restore line before guessing to display correct error. | ||||
$this->restoreLine(); | $this->restoreLine(); | ||||
$failed_parse = true; | $failed_parse = true; | ||||
} | } | ||||
} else if (!$ok) { | } else if (!$ok) { | ||||
$failed_parse = true; | $failed_parse = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,127 Lines • Show Last 20 Lines |
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