Open jiphex opened 9 years ago
Thanks your feedback!
You're right, Gogs should also check that the 7th character is .
as my quick think of solution.
Wouldn't that break repos which just have a file named "README"? (no .md)
Good catch, just check length first, then see if the 7th is .
or not.
Hi @jiphex , @jcracknell , I've pushed fix on dev
branch and feel free to test on https://try.gogs.io/
Seems OK: https://try.gogs.io/testzz/issue877
Great!
It still chooses the wrong README as in the case of this mirror
https://try.gogs.io/AdrianVerde/PHP
Where it prefers README.REDIST.BINS
instead of README.md
If I have a repo with a file named (for example)
README-stuff.md
as well asREADME.md
, Gogs will choose to display the former instead of the latter which would be expected. This is different from the behaviour of say, Github.It looks like this is because the check for whether a file is a README just checks if
filename[:6]
is "README", and the view gives up when it finds the first file.I've used this for extra documentation about specific aspects of the project, e.g README-Building.md. Github does the right thing here.