Global code search "View File" link broken #7165

Closed
opened 2025-11-02 07:18:07 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @D-04 on GitHub (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"
Originally created by @D-04 on GitHub (Apr 13, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.0 - Git version: - Operating system: 1.14 docker image (a491dc1f1e69) on linux amd64 <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No since REPO_INDEXER_ENABLED seems to be disabled - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> 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"
GiteaMirror added the type/bug label 2025-11-02 07:18:07 -06:00
Author
Owner

@D-04 commented on GitHub (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).

@D-04 commented on GitHub (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`).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7165