Differential D8516 Diff 20210 src/applications/repository/conduit/ConduitAPI_repository_create_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/conduit/ConduitAPI_repository_create_Method.php
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
// work properly now. | // work properly now. | ||||
$repository = PhabricatorRepository::initializeNewRepository( | $repository = PhabricatorRepository::initializeNewRepository( | ||||
$request->getUser()); | $request->getUser()); | ||||
$repository->setName($request->getValue('name')); | $repository->setName($request->getValue('name')); | ||||
$callsign = $request->getValue('callsign'); | $callsign = $request->getValue('callsign'); | ||||
if (!preg_match('/^[A-Z]+$/', $callsign)) { | if (!preg_match('/^[A-Z]+\z/', $callsign)) { | ||||
throw new ConduitException('ERR-BAD-CALLSIGN'); | throw new ConduitException('ERR-BAD-CALLSIGN'); | ||||
} | } | ||||
$repository->setCallsign($callsign); | $repository->setCallsign($callsign); | ||||
$vcs = $request->getValue('vcs'); | $vcs = $request->getValue('vcs'); | ||||
$map = array( | $map = array( | ||||
'git' => PhabricatorRepositoryType::REPOSITORY_TYPE_GIT, | 'git' => PhabricatorRepositoryType::REPOSITORY_TYPE_GIT, | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |