aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-03-03 19:01:33 +0900
committerGitHub <noreply@github.com>2023-03-03 18:01:33 +0800
commit699f20234b9f7cdbbeeee3be004470c598fa1147 (patch)
treeab762f9225be16ced346adfe7bccf423bf439f75 /routers
parent0bfcbcc5e769bd258e4f530e0f007f5465f42de5 (diff)
downloadgitea-699f20234b9f7cdbbeeee3be004470c598fa1147.tar.gz
gitea-699f20234b9f7cdbbeeee3be004470c598fa1147.zip
Use correct README link to render the README (#23152)
`renderReadmeFile` needs `readmeTreelink` as parameter but gets `treeLink`. The values of them look like as following: `treeLink`: `/{OwnerName}/{RepoName}/src/branch/{BranchName}` `readmeTreelink`: `/{OwnerName}/{RepoName}/src/branch/{BranchName}/{ReadmeFileName}` `path.Dir` in https://github.com/go-gitea/gitea/blob/8540fc45b11eff9a73753ca139f8ea5c38509bf5/routers/web/repo/view.go#L316 should convert `readmeTreelink` into `/{OwnerName}/{RepoName}/src/branch/{BranchName}` instead of the current `/{OwnerName}/{RepoName}/src/branch`. Fixes #23151 --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/view.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index e3c61fa408..8663e11382 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -186,7 +186,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
return
}
- renderReadmeFile(ctx, readmeFile, treeLink)
+ renderReadmeFile(ctx, readmeFile, fmt.Sprintf("%s/%s", treeLink, readmeFile.name))
}
// localizedExtensions prepends the provided language code with and without a