Skip to content

Commit b28c324

Browse files
a10121127966543
andauthored
fix wrong file link in code search page (go-gitea#15466) (go-gitea#15486)
in previous the grenrated link is ``testg/testrepo/src/commit/....`` which is not right. the right version is ``/testg/testrepo/.......`` (start wiht ``/``) or ``http://127.0.0.1:3000/xxxxx`` (full link) to make it hase same result with explore page I choose the secound style. fix go-gitea#15438 Signed-off-by: a1012112796 <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent ddfb729 commit b28c324

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routers/repo/search.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package repo
66

77
import (
8-
"path"
98
"strings"
109

1110
"code.gitea.io/gitea/modules/base"
@@ -40,7 +39,7 @@ func Search(ctx *context.Context) {
4039
ctx.Data["Keyword"] = keyword
4140
ctx.Data["Language"] = language
4241
ctx.Data["queryType"] = queryType
43-
ctx.Data["SourcePath"] = path.Join(setting.AppSubURL, ctx.Repo.Repository.Owner.Name, ctx.Repo.Repository.Name)
42+
ctx.Data["SourcePath"] = ctx.Repo.Repository.HTMLURL()
4443
ctx.Data["SearchResults"] = searchResults
4544
ctx.Data["SearchResultLanguages"] = searchResultLanguages
4645
ctx.Data["RequireHighlightJS"] = true

0 commit comments

Comments
 (0)