Merge pull request #589 from bjoernffm/master

fixed issue #573 (only numbers in repo names), added repo name to zip/ta...
This commit is contained in:
Gary Green
2015-07-28 12:27:42 +01:00
2 changed files with 6 additions and 4 deletions

View File

@@ -97,9 +97,8 @@ class TreeController implements ControllerProviderInterface
* Generating name for downloading, lowercasing and removing all non
* ascii and special characters
*/
$filename = strtolower($branch);
$filename = preg_replace('#[^a-z0-9]#', '_', $filename);
$filename = preg_replace('#_+#', '_', $filename);
$filename = strtolower($repo.'_'.$branch);
$filename = preg_replace('#[^a-z0-9]+#', '_', $filename);
$filename = $filename . '.' . $format;
$response = new BinaryFileResponse($file);

View File

@@ -42,7 +42,10 @@ class Client extends BaseClient
throw new \RuntimeException('There are no GIT repositories in ' . $path);
}
$allRepositories = array_merge($allRepositories, $repositories);
/**
* Use "+" to preserve keys, only a problem with numeric repos
*/
$allRepositories = $allRepositories + $repositories;
}
$allRepositories = array_unique($allRepositories, SORT_REGULAR);