mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* fix multiple readme file rendering and fix #1657 * remove unnecessary loop
This commit is contained in:
@@ -56,13 +56,19 @@ func renderDirectory(ctx *context.Context, treeLink string) {
|
||||
|
||||
var readmeFile *git.Blob
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() || !markup.IsReadmeFile(entry.Name()) {
|
||||
if entry.IsDir() {
|
||||
continue
|
||||
}
|
||||
|
||||
tp, ok := markup.ReadmeFileType(entry.Name())
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
// TODO: collect all possible README files and show with priority.
|
||||
readmeFile = entry.Blob()
|
||||
break
|
||||
if tp != "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if readmeFile != nil {
|
||||
|
Reference in New Issue
Block a user