3 final class DiffusionGitUploadPackSSHWorkflow
4 extends DiffusionGitSSHWorkflow
{
6 protected function didConstruct() {
7 $this->setName('git-upload-pack');
17 protected function executeRepositoryOperations() {
18 $is_proxy = $this->shouldProxy();
20 return $this->executeRepositoryProxyOperations($for_write = false);
23 $viewer = $this->getSSHUser();
24 $repository = $this->getRepository();
25 $device = AlmanacKeys
::getLiveDevice();
27 $skip_sync = $this->shouldSkipReadSynchronization();
29 $command = csprintf('git-upload-pack -- %s', $repository->getLocalPath());
31 $cluster_engine = id(new DiffusionRepositoryClusterEngine())
33 ->setRepository($repository)
35 ->synchronizeWorkingCopyBeforeRead();
38 $this->writeClusterEngineLogMessage(
40 "# Cleared to fetch on cluster host \"%s\".\n",
45 $command = PhabricatorDaemon
::sudoCommandAsDaemonUser($command);
47 $pull_event = $this->newPullEvent();
49 $future = id(new ExecFuture('%C', $command))
50 ->setEnv($this->getEnvironment());
52 $log = $this->newProtocolLog($is_proxy);
54 $this->setProtocolLog($log);
55 $log->didStartSession($command);
58 if (PhabricatorEnv
::getEnvConfig('phabricator.show-prototypes')) {
59 $protocol = new DiffusionGitUploadPackWireProtocol();
61 $protocol->setProtocolLog($log);
63 $this->setWireProtocol($protocol);
66 $err = $this->newPassthruCommand()
67 ->setIOChannel($this->getIOChannel())
68 ->setCommandChannelFromExecFuture($future)
72 $log->didEndSession();
77 ->setResultType(PhabricatorRepositoryPullEvent
::RESULT_ERROR
)
78 ->setResultCode($err);
81 ->setResultType(PhabricatorRepositoryPullEvent
::RESULT_PULL
)
88 $this->waitForGitClient();