Changeset View
Changeset View
Standalone View
Standalone View
src/ref/commit/ArcanistGitCommitSymbolCommitHardpointQuery.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | foreach ($pairs as $symbol => $line) { | ||||
$hash_map[$symbol] = $hash; | $hash_map[$symbol] = $hash; | ||||
} | } | ||||
$results = array(); | $results = array(); | ||||
foreach ($symbol_map as $key => $symbol) { | foreach ($symbol_map as $key => $symbol) { | ||||
$results[$key] = $hash_map[$symbol]; | $results[$key] = $hash_map[$symbol]; | ||||
} | } | ||||
foreach ($results as $key => $result) { | |||||
if ($result === null) { | |||||
continue; | |||||
} | |||||
$ref = id(new ArcanistCommitRef()) | |||||
->setCommitHash($result); | |||||
$results[$key] = $ref; | |||||
} | |||||
yield $this->yieldMap($results); | yield $this->yieldMap($results); | ||||
} | } | ||||
private function validateSymbol($symbol) { | private function validateSymbol($symbol) { | ||||
if (strpos($symbol, "\n") !== false) { | if (strpos($symbol, "\n") !== false) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Commit symbol "%s" contains a newline. This is not a valid '. | 'Commit symbol "%s" contains a newline. This is not a valid '. | ||||
'character in a Git commit symbol.', | 'character in a Git commit symbol.', | ||||
addcslashes($symbol, "\\\n"))); | addcslashes($symbol, "\\\n"))); | ||||
} | } | ||||
} | } | ||||
} | } |