Fix origin computation
parent
0261ce8092
commit
0fe200d6d9
|
@ -495,13 +495,20 @@ class GitLabDriver extends VcsDriver
|
||||||
private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber)
|
private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber)
|
||||||
{
|
{
|
||||||
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) {
|
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) {
|
||||||
|
if ($portNumber) {
|
||||||
|
return $guessedDomain.':'.$portNumber;
|
||||||
|
}
|
||||||
return $guessedDomain;
|
return $guessedDomain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($portNumber) {
|
||||||
|
$guessedDomain .= ':'.$portNumber;
|
||||||
|
}
|
||||||
|
|
||||||
while (null !== ($part = array_shift($urlParts))) {
|
while (null !== ($part = array_shift($urlParts))) {
|
||||||
$guessedDomain .= '/' . $part;
|
$guessedDomain .= '/' . $part;
|
||||||
|
|
||||||
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(preg_replace('{/}', ':'.$portNumber.'/', $guessedDomain, 1), $configuredDomains))) {
|
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(preg_replace('{:\d+}', '', $guessedDomain), $configuredDomains))) {
|
||||||
return $guessedDomain;
|
return $guessedDomain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ JSON;
|
||||||
JSON;
|
JSON;
|
||||||
|
|
||||||
$this->remoteFilesystem
|
$this->remoteFilesystem
|
||||||
->getContents($domain, $apiUrl, false, array())
|
->getContents($domain.':'.$port, $apiUrl, false, array())
|
||||||
->willReturn(sprintf($projectData, $domain, $port, $namespace))
|
->willReturn(sprintf($projectData, $domain, $port, $namespace))
|
||||||
->shouldBeCalledTimes(1);
|
->shouldBeCalledTimes(1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue