summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-03-04 00:38:11 -0500
committerGitHub <noreply@github.com>2023-03-04 00:38:11 -0500
commit1322cd7a58f6c2041624eddaf9393cc8947e5a5d (patch)
treed8169ef1dd0a4a5d5e5e9ce61dbdf6b56595ed7f /routers
parent464bbd747edb3054bca061ad3ddbaf3555790764 (diff)
downloadgitea-1322cd7a58f6c2041624eddaf9393cc8947e5a5d.tar.gz
gitea-1322cd7a58f6c2041624eddaf9393cc8947e5a5d.zip
Use correct README link to render the README (#23152) (#23264)
Backport #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: yp05327 <576951401@qq.com> 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