Differential D17508 Diff 42114 src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | private function installGitHook() { | ||||
} | } | ||||
$this->installHook($root.$path); | $this->installHook($root.$path); | ||||
} | } | ||||
private function loadGitRemoteRefs(PhabricatorRepository $repository) { | private function loadGitRemoteRefs(PhabricatorRepository $repository) { | ||||
$remote_envelope = $repository->getRemoteURIEnvelope(); | $remote_envelope = $repository->getRemoteURIEnvelope(); | ||||
// NOTE: "git ls-remote" does not support "--" until circa January 2016. | |||||
// See T12416. None of the flags to "ls-remote" appear dangerous, and | |||||
// other checks make it difficult to configure a suspicious remote URI. | |||||
list($stdout) = $repository->execxRemoteCommand( | list($stdout) = $repository->execxRemoteCommand( | ||||
'ls-remote -- %P', | 'ls-remote %P', | ||||
$remote_envelope); | $remote_envelope); | ||||
$map = array(); | $map = array(); | ||||
$lines = phutil_split_lines($stdout, false); | $lines = phutil_split_lines($stdout, false); | ||||
foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
list($hash, $name) = preg_split('/\s+/', $line, 2); | list($hash, $name) = preg_split('/\s+/', $line, 2); | ||||
// If the remote has a HEAD, just ignore it. | // If the remote has a HEAD, just ignore it. | ||||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |