Changeset View
Changeset View
Standalone View
Standalone View
scripts/repository/commit_hook.php
Context not available. | |||||
if ($argc > 1) { | if ($argc > 1) { | ||||
$context = $argv[1]; | $context = $argv[1]; | ||||
$context = explode(':', $context, 2); | $context = @explode(':', $context, 2); | ||||
$argv[1] = $context[0]; | $argv[1] = $context[0]; | ||||
if (count($context) > 1) { | if (count($context) > 1) { | ||||
Context not available. | |||||
exit($err); | exit($err); | ||||
} else if ($repository->isGit() || $repository->isHg()) { | } else if ($repository->isGit() || $repository->isHg()) { | ||||
$username = getenv(DiffusionCommitHookEngine::ENV_USER); | $username = getenv(DiffusionCommitHookEngine::ENV_USER); | ||||
if (!strlen($username)) { | if (!@strlen($username)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'No Direct Pushes: You are pushing directly to a repository hosted '. | 'No Direct Pushes: You are pushing directly to a repository hosted '. | ||||
Context not available. | |||||
$engine->setOriginalArgv(array_slice($argv, 2)); | $engine->setOriginalArgv(array_slice($argv, 2)); | ||||
$remote_address = getenv(DiffusionCommitHookEngine::ENV_REMOTE_ADDRESS); | $remote_address = getenv(DiffusionCommitHookEngine::ENV_REMOTE_ADDRESS); | ||||
if (strlen($remote_address)) { | if (@strlen($remote_address)) { | ||||
$engine->setRemoteAddress($remote_address); | $engine->setRemoteAddress($remote_address); | ||||
} | } | ||||
$remote_protocol = getenv(DiffusionCommitHookEngine::ENV_REMOTE_PROTOCOL); | $remote_protocol = getenv(DiffusionCommitHookEngine::ENV_REMOTE_PROTOCOL); | ||||
if (strlen($remote_protocol)) { | if (@strlen($remote_protocol)) { | ||||
$engine->setRemoteProtocol($remote_protocol); | $engine->setRemoteProtocol($remote_protocol); | ||||
} | } | ||||
$request_identifier = getenv(DiffusionCommitHookEngine::ENV_REQUEST); | $request_identifier = getenv(DiffusionCommitHookEngine::ENV_REQUEST); | ||||
if (strlen($request_identifier)) { | if (@strlen($request_identifier)) { | ||||
$engine->setRequestIdentifier($request_identifier); | $engine->setRequestIdentifier($request_identifier); | ||||
} | } | ||||
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