diff --git a/src/GitList/Controller/TreeController.php b/src/GitList/Controller/TreeController.php index b920194..d3d9fe6 100644 --- a/src/GitList/Controller/TreeController.php +++ b/src/GitList/Controller/TreeController.php @@ -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); diff --git a/src/GitList/Git/Client.php b/src/GitList/Git/Client.php index 8a1e055..14575e8 100644 --- a/src/GitList/Git/Client.php +++ b/src/GitList/Git/Client.php @@ -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);