Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistGitLandEngine.php
Context not available. | |||||
$foreach_lines = phutil_split_lines($foreach_lines, false); | $foreach_lines = phutil_split_lines($foreach_lines, false); | ||||
foreach ($foreach_lines as $line) { | foreach ($foreach_lines as $line) { | ||||
if (!strlen($line)) { | if (!@strlen($line)) { | ||||
continue; | continue; | ||||
} | } | ||||
$expect_parts = 2; | $expect_parts = 2; | ||||
$parts = explode(' ', $line, $expect_parts); | $parts = @explode(' ', $line, $expect_parts); | ||||
if (count($parts) !== $expect_parts) { | if (count($parts) !== $expect_parts) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
Context not available. | |||||
$ref_hash = $parts[1]; | $ref_hash = $parts[1]; | ||||
$matches = null; | $matches = null; | ||||
$ok = preg_match('(^refs/heads/(.*)\z)', $ref_name, $matches); | $ok = @preg_match('(^refs/heads/(.*)\z)', $ref_name, $matches); | ||||
if ($ok === false) { | if ($ok === false) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
Context not available. | |||||
$into_commit, | $into_commit, | ||||
$max_hash)); | $max_hash)); | ||||
$changes = trim($changes); | $changes = trim($changes); | ||||
if (!strlen($changes)) { | if (!@strlen($changes)) { | ||||
// TODO: We could make a more significant effort to identify the | // TODO: We could make a more significant effort to identify the | ||||
// human-readable symbol which led us to try to land this ref. | // human-readable symbol which led us to try to land this ref. | ||||
Context not available. | |||||
gitsprintf('%s', $commit)); | gitsprintf('%s', $commit)); | ||||
$info = trim($info); | $info = trim($info); | ||||
list($date, $author, $email) = explode("\n", $info, 3); | list($date, $author, $email) = @explode("\n", $info, 3); | ||||
return array( | return array( | ||||
"$author <{$email}>", | "$author <{$email}>", | ||||
Context not available. | |||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
foreach ($onto_refs as $onto_ref) { | foreach ($onto_refs as $onto_ref) { | ||||
if (!strlen($onto_ref)) { | if (!@strlen($onto_ref)) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Selected "onto" ref "%s" is invalid: the empty string is not '. | 'Selected "onto" ref "%s" is invalid: the empty string is not '. | ||||
Context not available. | |||||
$commits = phutil_split_lines($commits, false); | $commits = phutil_split_lines($commits, false); | ||||
$is_first = true; | $is_first = true; | ||||
foreach ($commits as $line) { | foreach ($commits as $line) { | ||||
if (!strlen($line)) { | if (!@strlen($line)) { | ||||
continue; | continue; | ||||
} | } | ||||
$parts = explode("\0", $line, 4); | $parts = @explode("\0", $line, 4); | ||||
if (count($parts) < 3) { | if (count($parts) < 3) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
Context not available. | |||||
if (!isset($commit_map[$hash])) { | if (!isset($commit_map[$hash])) { | ||||
$parents = $parts[1]; | $parents = $parts[1]; | ||||
$parents = trim($parents); | $parents = trim($parents); | ||||
if (strlen($parents)) { | if (@strlen($parents)) { | ||||
$parents = explode(' ', $parents); | $parents = @explode(' ', $parents); | ||||
} else { | } else { | ||||
$parents = array(); | $parents = array(); | ||||
} | } | ||||
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