You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid re-scanning directories when searching for READMEs.
When rendering a directory's README we have scanned its Tree once,
looking for the README; but we allow READMEs in some special subfolders
too (docs/, .gitea/, .github/), and may need to scan them.
Since we've already scanned the top Tree, we have the subfolders' SHA1
object IDs cached, so, as a minor optimization, instead of calling
SubTree(path string), which re-scans the Tree before using
Repository.getTree() to actually produce their Tree objects,
call Repository.getTree() directly.
But it's a private method, so first expose it via new TreeEntry.Tree().
Feedback from @lunny: https://github.com/go-gitea/gitea/pull/22177/files#r1053953034
0 commit comments