Differential D11541 Diff 27767 src/applications/diffusion/ssh/DiffusionGitReceivePackSSHWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/ssh/DiffusionGitReceivePackSSHWorkflow.php
| <?php | <?php | ||||
| final class DiffusionGitReceivePackSSHWorkflow extends DiffusionGitSSHWorkflow { | final class DiffusionGitReceivePackSSHWorkflow extends DiffusionGitSSHWorkflow { | ||||
| protected function didConstruct() { | protected function didConstruct() { | ||||
| $this->setName('git-receive-pack'); | $this->setName('git-receive-pack'); | ||||
| $this->setArguments( | $this->setArguments( | ||||
| array( | array( | ||||
| array( | array( | ||||
| 'name' => 'dir', | 'name' => 'dir', | ||||
| 'wildcard' => true, | 'wildcard' => true, | ||||
| ), | ), | ||||
| )); | )); | ||||
| } | } | ||||
| protected function executeRepositoryOperations() { | protected function executeRepositoryOperations() { | ||||
| $args = $this->getArgs(); | $repository = $this->getRepository(); | ||||
| $path = head($args->getArg('dir')); | |||||
| $repository = $this->loadRepository($path); | |||||
| // This is a write, and must have write access. | // This is a write, and must have write access. | ||||
| $this->requireWriteAccess(); | $this->requireWriteAccess(); | ||||
| $command = csprintf('git-receive-pack %s', $repository->getLocalPath()); | $command = csprintf('git-receive-pack %s', $repository->getLocalPath()); | ||||
| $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command); | $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command); | ||||
| $future = id(new ExecFuture('%C', $command)) | $future = id(new ExecFuture('%C', $command)) | ||||
| Show All 18 Lines | |||||