Skip to content

Commit

Permalink
fix wrong file link in code search page (go-gitea#15466)
Browse files Browse the repository at this point in the history
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 <1012112796@qq.com>

Co-authored-by: 6543 <6543@obermui.de>
  • Loading branch information
a1012112796 and 6543 committed Apr 15, 2021
1 parent ddfb729 commit e447115
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions routers/repo/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package repo

import (
"path"
"strings"

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

0 comments on commit e447115

Please sign in to comment.