mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Fixes #311
This commit is contained in:
@@ -50,7 +50,7 @@ class Client extends BaseClient
|
|||||||
return $allRepositories;
|
return $allRepositories;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function recurseDirectory($path)
|
private function recurseDirectory($path, $topLevel = true)
|
||||||
{
|
{
|
||||||
$dir = new \DirectoryIterator($path);
|
$dir = new \DirectoryIterator($path);
|
||||||
|
|
||||||
@@ -90,10 +90,21 @@ class Client extends BaseClient
|
|||||||
$description = null;
|
$description = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$repositories[$file->getFilename()] = array('name' => $file->getFilename(), 'path' => $file->getPathname(), 'description' => $description);
|
if (!$topLevel) {
|
||||||
|
$repoName = $file->getPathInfo()->getFilename() . '/' . $file->getFilename();
|
||||||
|
} else {
|
||||||
|
$repoName = $file->getFilename();
|
||||||
|
}
|
||||||
|
|
||||||
|
$repositories[$repoName] = array(
|
||||||
|
'name' => $repoName,
|
||||||
|
'path' => $file->getPathname(),
|
||||||
|
'description' => $description
|
||||||
|
);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
$repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname()));
|
$repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname(), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user