Properly handling Gitlab URLs that contain ports.
Fixes #484, closes #501
This commit is contained in:
parent
2875badb0a
commit
7986688b1e
2 changed files with 20 additions and 5 deletions
|
|
@ -107,13 +107,18 @@ class ProjectService
|
|||
$matches = array();
|
||||
$reference = $project->getReference();
|
||||
|
||||
if ($project->getType() == 'gitlab' && preg_match('`^(.*)@(.*):(.*)/(.*)\.git`', $reference, $matches)) {
|
||||
if ($project->getType() == 'gitlab') {
|
||||
$info = array();
|
||||
$info['user'] = $matches[1];
|
||||
$info['domain'] = $matches[2];
|
||||
|
||||
if (preg_match('`^(.*)@(.*):([0-9]+)?/?(.*)/(.*)\.git`', $reference, $matches)) {
|
||||
$info['user'] = $matches[1];
|
||||
$info['domain'] = $matches[2];
|
||||
$info['port'] = $matches[3];
|
||||
|
||||
$project->setReference($matches[4] . '/' . $matches[5]);
|
||||
}
|
||||
|
||||
$project->setAccessInformation($info);
|
||||
$project->setReference($matches[3] . '/' . $matches[4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue