-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix Readme render bug #19992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Readme render bug #19992
Conversation
I'm not sure that there's actually any overloading of the TreePath going on here. The TreePath is the path that the user has requested. They didn't request the README file explicitly - we're just additionally rendering the README file within the rendering of the directory. |
I think it's correct, the render is independent of the TreePath at the moment. How about a README in a subdir ? https://try.gitea.io/wxiaoguang/test/src/branch/master/subdir https://try.gitea.io/wxiaoguang/test/src/branch/master/subdir/README.md I have tested that it should work correctly for sub directory, then the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work for readmes that are actually within docs/ .gitea/ .github/
Ignore me readmeFile.name has the right path bits.
Ignore me readmefile.Name has the local path
The test you were describing was subdir/ readmes. I was actually concerned about the case where TreePath is "" but the readme file is in In those cases, readmeFile.Name actually is as above - in order that this kind of thing worked transparently and I had forgotten that that was the case. |
Sorry for that I didn't say it clearly ..... |
Fix go-gitea#19988 Co-authored-by: zeripath <[email protected]>
Fix go-gitea#19988 Co-authored-by: zeripath <[email protected]>
Fix #19988
The problem is caused sometiems
TreePath
is not the file path but the file's parent dir path.This is a temporory bug fix, the same variable should not have different ,meaning.
For README render, it's an index file, so
treepath
is""
or"/"
, but we need to render theREADME.md
. That's the problem.