Skip to content

Commit 08ba895

Browse files
a10121127966543
andauthored
fix wrong file link in code search page (#15466)
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 #15438 Signed-off-by: a1012112796 <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 1ee7769 commit 08ba895

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
@@ -6,7 +6,6 @@ package repo
66

77
import (
88
"net/http"
9-
"path"
109
"strings"
1110

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

0 commit comments

Comments
 (0)