• Dylan Griffith's avatar
    Ensure code search results link to searched ref · 0b49e64b
    Dylan Griffith authored
    Code searches allow you to choose branch name or tag when searching for
    code. Previously the blob search results were linking to the URL with
    the SHA of the branch and not the actual branch name being searched.
    This works OK in some cases but usually the user expecting to be linked
    to `/master/` instead of `/<some-sha>/` and in particular it is
    problematic because when you are loading a file in a specific SHA you
    cannot click the edit button to edit that file you just loaded.
    
    We fix this by using the param `repository_ref` when present and
    defaulting to the `default_branch` when absent.
    
    See more at https://gitlab.com/gitlab-org/gitlab/-/issues/254932
    0b49e64b
_blob.html.haml 264 Bytes