Fix Permalink when navigating non-default branch and opening files
What does this MR do and why?
When browsing files on a branch, starting from root tree, and opening a file, the Permalink has the default branch SHA instead of the current branch.
This MR fixes #378790, #367243 by making sure the commit SHA is used when the url is created.
Screenshots or screen recordings
How to set up and validate locally
- Create a branch which points to a different commit than the default branch tip
- Visit this branch root_tree (
***/-/tree/my_branch
) - Click on a file
- Compare displayed commit hash and Permalink
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Guillaume CHAUVEL