mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-02-04 21:59:43 +01:00
* Fix notice error if file readme don't exists.
* Show readme box for file with `readme` suffix (eg readme, readme.md. readme.txt, readme.markdown etc).
This commit is contained in:
@@ -252,12 +252,9 @@ class Utils
|
||||
$files = $repository->getTree('master')->output();
|
||||
|
||||
foreach ($files as $fileInfo)
|
||||
if (preg_match('/^readme(\.md|\.markdown|)$/i', $fileInfo['name'])) {
|
||||
$readmeFile = $fileInfo['name'];
|
||||
break;
|
||||
if (preg_match('/^readme*/i', $fileInfo['name'])) {
|
||||
return array('filename' => $fileInfo['name'], 'content' => $repository->getBlob("$branch:'".$fileInfo['name']."'")->output());
|
||||
}
|
||||
|
||||
if ($readmeFile) return array('filename' => $readmeFile, 'content' => $repository->getBlob("$branch:'$readmeFile'")->output());
|
||||
return array();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user