Page MenuHomePhabricator

D16092.diff
No OneTemporary

D16092.diff

diff --git a/src/applications/diffusion/protocol/DiffusionCommandEngine.php b/src/applications/diffusion/protocol/DiffusionCommandEngine.php
--- a/src/applications/diffusion/protocol/DiffusionCommandEngine.php
+++ b/src/applications/diffusion/protocol/DiffusionCommandEngine.php
@@ -9,6 +9,7 @@
private $passthru;
private $connectAsDevice;
private $sudoAsDaemon;
+ private $uri;
public static function newCommandEngine(PhabricatorRepository $repository) {
$engines = self::newCommandEngines();
@@ -48,6 +49,16 @@
return $this->repository;
}
+ public function setURI(PhutilURI $uri) {
+ $this->uri = $uri;
+ $this->setProtocol($uri->getProtocol());
+ return $this;
+ }
+
+ public function getURI() {
+ return $this->uri;
+ }
+
public function setProtocol($protocol) {
$this->protocol = $protocol;
return $this;
diff --git a/src/applications/diffusion/protocol/DiffusionGitCommandEngine.php b/src/applications/diffusion/protocol/DiffusionGitCommandEngine.php
--- a/src/applications/diffusion/protocol/DiffusionGitCommandEngine.php
+++ b/src/applications/diffusion/protocol/DiffusionGitCommandEngine.php
@@ -30,6 +30,21 @@
$env['GIT_SSH'] = $this->getSSHWrapper();
}
+ if ($this->isAnyHTTPProtocol()) {
+ $uri = $this->getURI();
+ if ($uri) {
+ $proxy = PhutilHTTPEngineExtension::buildHTTPProxyURI($uri);
+ if ($proxy) {
+ if ($this->isHTTPSProtocol()) {
+ $env_key = 'https_proxy';
+ } else {
+ $env_key = 'http_proxy';
+ }
+ $env[$env_key] = (string)$proxy;
+ }
+ }
+ }
+
return $env;
}
diff --git a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
--- a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
+++ b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
@@ -598,7 +598,7 @@
->setArgv($argv)
->setSudoAsDaemon(true)
->setCredentialPHID($repository->getCredentialPHID())
- ->setProtocol($repository->getRemoteProtocol())
+ ->setURI($repository->getRemoteURI())
->newFuture();
$future->setCWD($local_path);
@@ -704,7 +704,7 @@
->setArgv($argv)
->setConnectAsDevice(true)
->setSudoAsDaemon(true)
- ->setProtocol($fetch_uri->getProtocol())
+ ->setURI($fetch_uri)
->newFuture();
$future->setCWD($local_path);
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -508,7 +508,7 @@
return DiffusionCommandEngine::newCommandEngine($this)
->setArgv($argv)
->setCredentialPHID($this->getCredentialPHID())
- ->setProtocol($this->getRemoteProtocol());
+ ->setURI($this->getRemoteURIObject());
}
/* -( Local Command Execution )-------------------------------------------- */
diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php
--- a/src/applications/repository/storage/PhabricatorRepositoryURI.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php
@@ -587,11 +587,10 @@
public function newCommandEngine() {
$repository = $this->getRepository();
- $protocol = $this->getEffectiveURI()->getProtocol();
return DiffusionCommandEngine::newCommandEngine($repository)
->setCredentialPHID($this->getCredentialPHID())
- ->setProtocol($protocol);
+ ->setURI($this->getEffectiveURI());
}
public function getURIScore() {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 4:17 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6741265
Default Alt Text
D16092.diff (3 KB)

Event Timeline