Skip to content

Update RefSelector to show check only for correct ref for commits

What does this MR do and why?

Update RefSelector to show check only for correct ref

  • disambiguate between branch and tag when showing checkmark for selected ref
  • updates commit page callback to route to the correct page when the use_ref_type_parameter flag is enabled

Contributes to: #219583 (closed)

How to set up and validate locally

  1. enable the use_ref_type_parameter feature flag
  2. create a project
  3. make a commit with some change(echo 'hello' > hello.txt && git add hello.txt && git commit -m 'hello')
  4. add a tag and push it (git tag 'hello' && git push origin hello)
  5. make another change (echo 'hello again ' >> hello_again.txt && git add hello_again.txt && git commit -m 'hello again')
  6. make a branch with the same name and push (git checkout -b hello && git push origin refs/heads/hello)
  7. navigate to the commits view (e.g http://127.0.0.1:3000/root/projectname/-/commits/main?ref_type=heads)
  8. use the ref selector drop down menu to switch between branch and tag and see that the commits in each are as expected and that the checkmark is next to the correct item

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #219583 (closed)

Edited by Jerry Seto

Merge request reports

Loading