Changeset View
Changeset View
Standalone View
Standalone View
scripts/repository/commit_hook.php
Show All 11 Lines | |||||
$repository = id(new PhabricatorRepositoryQuery()) | $repository = id(new PhabricatorRepositoryQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withCallsigns(array($argv[1])) | ->withCallsigns(array($argv[1])) | ||||
->needProjectPHIDs(true) | ->needProjectPHIDs(true) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$repository) { | if (!$repository) { | ||||
throw new Exception(pht('No such repository "%s"!', $callsign)); | throw new Exception(pht('No such repository "%s"!', $argv[1])); | ||||
} | } | ||||
if (!$repository->isHosted()) { | if (!$repository->isHosted()) { | ||||
// This should be redundant, but double check just in case. | // This should be redundant, but double check just in case. | ||||
throw new Exception(pht('Repository "%s" is not hosted!', $callsign)); | throw new Exception(pht('Repository "%s" is not hosted!', $argv[1])); | ||||
} | } | ||||
$engine->setRepository($repository); | $engine->setRepository($repository); | ||||
// Figure out which user is writing the commit. | // Figure out which user is writing the commit. | ||||
if ($repository->isGit() || $repository->isHg()) { | if ($repository->isGit() || $repository->isHg()) { | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |