Skip to content

Commit 4be893f

Browse files
committed
1 parent fb49fc2 commit 4be893f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/web/repo/view.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const (
5858
// entries == ctx.Repo.Commit.SubTree(ctx.Repo.TreePath).ListEntries()
5959
//
6060
// FIXME: There has to be a more efficient way of doing this
61-
func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, recurse bool) (string, *git.TreeEntry, error) {
61+
func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, tryWellKnownDirs bool) (string, *git.TreeEntry, error) {
6262
// Create a list of extensions in priority order
6363
// 1. Markdown files - with and without localisation - e.g. README.en-us.md or README.md
6464
// 2. Txt files - e.g. README.txt
@@ -69,7 +69,7 @@ func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, rec
6969

7070
docsEntries := make([]*git.TreeEntry, 3) // (one of docs/, .gitea/ or .github/)
7171
for _, entry := range entries {
72-
if recurse && entry.IsDir() {
72+
if tryWellKnownDirs && entry.IsDir() {
7373
// as a special case for the top-level repo introduction README,
7474
// fall back to subfolders, looking for e.g. docs/README.md, .gitea/README.zh-CN.txt, .github/README.txt, ...
7575
// (note that docsEntries is ignored unless we are at the root)

0 commit comments

Comments
 (0)