Skip to content

Fix incorrect links when coming to 'Find file' from a file view

Pham Sy Minh requested to merge shelld3v/gitlab:fix-find-file-links into master

What does this MR do and why?

Fix links in the Find file page having a prefix of the last viewed file path. The problem only happens when you click to visit a file and then click on the Find file button

Closes #363492 (closed)

Screenshots or screen recordings

How to set up and validate locally

Quoted from #363492 (closed):

Steps to reproduce

  1. Go to a folder page (eg. https://gitlab.com/gitlab-org/gitlab/-/tree/master)
  2. Click on a file. Needs to be in the same tab! (eg. https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md)
  3. Click on Find file button. URL is https://gitlab.com/gitlab-org/gitlab/-/find_file/master/README.md. The filename is incorrectly added to the URL.
  4. Click on any files in the result. Error message:

"README.md/.browserslistrc" did not exist on "master"

MR acceptance checklist

Merge request reports

Loading