Differential D21864 Diff 52157 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 232 Lines • ▼ Show 20 Lines | private function installHookDirectory($path) { | ||||
Filesystem::createDirectory($path, 0755); | Filesystem::createDirectory($path, 0755); | ||||
Filesystem::writeFile($path.'/README', $readme); | Filesystem::writeFile($path.'/README', $readme); | ||||
} | } | ||||
private function getHookContextIdentifier(PhabricatorRepository $repository) { | private function getHookContextIdentifier(PhabricatorRepository $repository) { | ||||
$identifier = $repository->getPHID(); | $identifier = $repository->getPHID(); | ||||
$instance = PhabricatorEnv::getEnvConfig('cluster.instance'); | $instance = PhabricatorEnv::getEnvConfig('cluster.instance'); | ||||
if (strlen($instance)) { | if ($instance !== null && strlen($instance)) { | ||||
$identifier = "{$identifier}:{$instance}"; | $identifier = "{$identifier}:{$instance}"; | ||||
} | } | ||||
return $identifier; | return $identifier; | ||||
} | } | ||||
/* -( Pulling Git Working Copies )----------------------------------------- */ | /* -( Pulling Git Working Copies )----------------------------------------- */ | ||||
▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | private function loadGitRemoteRefs( | ||||
} | } | ||||
list($stdout) = $repository->execxRemoteCommand( | list($stdout) = $repository->execxRemoteCommand( | ||||
'ls-remote %P %Ls', | 'ls-remote %P %Ls', | ||||
$remote_envelope, | $remote_envelope, | ||||
$ref_rules); | $ref_rules); | ||||
// Empty repositories don't have any refs. | // Empty repositories don't have any refs. | ||||
if (!strlen(rtrim($stdout))) { | if ($stdout === null || !strlen(rtrim($stdout))) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$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); | ||||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |