mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
Treat non-existing description file on repositories, fixes #41
This commit is contained in:
@@ -81,9 +81,15 @@ class Client
|
||||
|
||||
if ($file->isDir() && $isRepository || $isBare) {
|
||||
if ($isBare) {
|
||||
$description = file_get_contents($file->getPathname() . '/description');
|
||||
$description = $file->getPathname() . '/description';
|
||||
} else {
|
||||
$description = file_get_contents($file->getPathname() . '/.git/description');
|
||||
$description = $file->getPathname() . '/.git/description';
|
||||
}
|
||||
|
||||
if (file_exists($description)) {
|
||||
$description = file_get_contents($description);
|
||||
} else {
|
||||
$description = 'There is no repository description file. Please, create one to remove this message.';
|
||||
}
|
||||
|
||||
$repositories[] = array('name' => $file->getFilename(), 'path' => $file->getPathname(), 'description' => $description);
|
||||
|
||||
Reference in New Issue
Block a user