Skip to content

Global code search "View File" link broken #15438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 6 tasks
D-04 opened this issue Apr 13, 2021 · 1 comment · Fixed by #15466
Closed
2 of 6 tasks

Global code search "View File" link broken #15438

D-04 opened this issue Apr 13, 2021 · 1 comment · Fixed by #15466
Labels
Milestone

Comments

@D-04
Copy link

D-04 commented Apr 13, 2021

  • Gitea version (or commit ref): 1.14.0
  • Git version:
  • Operating system: 1.14 docker image (a491dc1f1e69) on linux amd64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No since REPO_INDEXER_ENABLED seems to be disabled
  • Log gist:

Description

When using Code Search the "View File" link adds the orga/repo path after the already existing one ending up with a broken 404 link like: https://foo.bar/orga/repo/orga/repo/src/commit/<hash>/README.md instead of https://foo.bar/orga/repo/src/commit/<hash>/README.md.

Steps to Reproduce

  1. Create a new Gitea Instance (I used Docker) and set REPO_INDEXER_ENABLED=true in the app.ini file.
  2. Create an Organisation and a repository
  3. Commit a file to the repository
  4. Search for some content in the file and press "View File"
@D-04
Copy link
Author

D-04 commented Apr 13, 2021

This seems to only affect the repository code search (/orga/repo/search?q=foo) and not the explore code search (/explore/code).

@lunny lunny added the type/bug label Apr 13, 2021
@lunny lunny added this to the 1.14.1 milestone Apr 13, 2021
a1012112796 added a commit to a1012112796/gitea that referenced this issue Apr 14, 2021
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]>
6543 added a commit that referenced this issue Apr 14, 2021
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]>
a1012112796 added a commit to a1012112796/gitea that referenced this issue Apr 15, 2021
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]>
lafriks pushed a commit that referenced this issue Apr 15, 2021
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]>

Co-authored-by: 6543 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Jun 4, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
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]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants