Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/ssh/DiffusionSSHGitUploadPackWorkflow.php
| Show All 16 Lines | final class DiffusionSSHGitUploadPackWorkflow | ||||
| protected function executeRepositoryOperations() { | protected function executeRepositoryOperations() { | ||||
| $args = $this->getArgs(); | $args = $this->getArgs(); | ||||
| $path = head($args->getArg('dir')); | $path = head($args->getArg('dir')); | ||||
| $repository = $this->loadRepository($path); | $repository = $this->loadRepository($path); | ||||
| $command = csprintf('git-upload-pack -- %s', $repository->getLocalPath()); | $command = csprintf('git-upload-pack -- %s', $repository->getLocalPath()); | ||||
| $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command); | $command = PhabricatorDaemon::sudoCommandAsDaemonUser($command); | ||||
| $future = new ExecFuture('%C', $command); | $future = id(new ExecFuture('%C', $command)) | ||||
| ->setEnv($this->getEnvironment()); | |||||
| $err = $this->newPassthruCommand() | $err = $this->newPassthruCommand() | ||||
| ->setIOChannel($this->getIOChannel()) | ->setIOChannel($this->getIOChannel()) | ||||
| ->setCommandChannelFromExecFuture($future) | ->setCommandChannelFromExecFuture($future) | ||||
| ->execute(); | ->execute(); | ||||
| if (!$err) { | if (!$err) { | ||||
| $this->waitForGitClient(); | $this->waitForGitClient(); | ||||
| } | } | ||||
| return $err; | return $err; | ||||
| } | } | ||||
| } | } | ||||