Skip to content

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

  1. Create a branch which points to a different commit than the default branch tip
  2. Visit this branch root_tree (***/-/tree/my_branch)
  3. Click on a file
  4. 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.

Edited by Guillaume CHAUVEL

Merge request reports

Loading