Properly handling Gitlab URLs that contain ports.

Fixes #484, closes #501
This commit is contained in:
Dan Cryer 2014-07-30 15:33:05 +01:00
commit 7986688b1e
2 changed files with 20 additions and 5 deletions

View file

@ -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]);
}
}
}