Fix incorrect links when coming to 'Find file' from a file view
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
- Go to a folder page (eg. https://gitlab.com/gitlab-org/gitlab/-/tree/master)
- Click on a file. Needs to be in the same tab! (eg. https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md)
- 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.
- Click on any files in the result. Error message:
"README.md/.browserslistrc" did not exist on "master"
MR acceptance checklist
-
I have evaluated the MR acceptance checklist for this MR.