Special README paths can be infinitely nested #10508

Closed
opened 2025-11-02 09:09:48 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @kousu on GitHub (Mar 25, 2023).

Description

Gitea supports loading READMEs from ./README.md but also ./README, ./README.txt, ./README.zh.md, etc, and also also ./docs/README.md, ./.github/README.md, ./.gitea/README.md.

But currently it also supports infinitely nested copies of these special subdirs, like this regex: ./({docs,.github,.gitea}/)+README.*

Eg. https://try.gitea.io/kousu/test-readme-recurse/

Gitea Version

1.20.0+dev-265-gc5cfc0855

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Screenshot 2023-03-24 at 21-01-53 test-readme-recurse

Git Version

2.24.1

Operating System

Ubuntu 22.04

How are you running Gitea?

I built mine at home.

Database

SQLite

Originally created by @kousu on GitHub (Mar 25, 2023). ### Description Gitea supports loading READMEs from `./README.md` but also `./README`, `./README.txt`, `./README.zh.md`, etc, and also also `./docs/README.md`, `./.github/README.md`, `./.gitea/README.md`. But currently it **also** supports infinitely nested copies of these special subdirs, like this regex: `./({docs,.github,.gitea}/)+README.*` Eg. https://try.gitea.io/kousu/test-readme-recurse/ ### Gitea Version 1.20.0+dev-265-gc5cfc0855 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots ![Screenshot 2023-03-24 at 21-01-53 test-readme-recurse](https://user-images.githubusercontent.com/987487/227672595-dfb5a809-d2f3-4c76-b1b6-a7d8a982a468.png) ### Git Version 2.24.1 ### Operating System Ubuntu 22.04 ### How are you running Gitea? I built mine at home. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 09:09:48 -06:00
Author
Owner

@kousu commented on GitHub (Mar 25, 2023):

This was introduced when I was responding to code review during https://github.com/go-gitea/gitea/pull/22177.

There is a test I added in #23185 for this, but I left commented out because I knew this was broken.

@kousu commented on GitHub (Mar 25, 2023): This was introduced when I was responding to code review during https://github.com/go-gitea/gitea/pull/22177. There is a test I added in #23185 for this, but I left commented out because I knew this was broken.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10508