@@ -58,7 +58,7 @@ const (
58
58
// entries == ctx.Repo.Commit.SubTree(ctx.Repo.TreePath).ListEntries()
59
59
//
60
60
// 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 ) {
62
62
// Create a list of extensions in priority order
63
63
// 1. Markdown files - with and without localisation - e.g. README.en-us.md or README.md
64
64
// 2. Txt files - e.g. README.txt
@@ -69,7 +69,7 @@ func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, rec
69
69
70
70
docsEntries := make ([]* git.TreeEntry , 3 ) // (one of docs/, .gitea/ or .github/)
71
71
for _ , entry := range entries {
72
- if recurse && entry .IsDir () {
72
+ if tryWellKnownDirs && entry .IsDir () {
73
73
// as a special case for the top-level repo introduction README,
74
74
// fall back to subfolders, looking for e.g. docs/README.md, .gitea/README.zh-CN.txt, .github/README.txt, ...
75
75
// (note that docsEntries is ignored unless we are at the root)
0 commit comments