Loading
Send fully qualified ref in commits list query
What does this MR do and why?
Fixes #628204
When a branch and a tag share the same name, the Vue commits list sent the bare ref name to the GraphQL commits query. Git resolves bare names with refs/tags/* taking precedence over refs/heads/*, so the page showed the tag's history even when the URL had ?ref_type=heads or the user picked the branch from the disambiguation popup.
This MR adds a qualifiedRef computed that prefixes the ref with refs/<type>/ when the ref type is known (heads or tags), so an explicit ref type always wins. Commit SHAs have no ref type and are sent unchanged. pipelineRef stays bare because pipelines are matched on their stored bare ref name.
Refs containing slashes (e.g. feature/dev) pass through untouched, producing refs/heads/feature/dev.
Screenshots or screen recordings
| before | after |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In a test repo, create a branch and a tag with the same name pointing at different commits:
git checkout -b dev && git commit --allow-empty -m "branch commit" && git push origin dev git tag dev HEAD~1 && git push origin refs/tags/dev - Visit
/<project>/-/commits/dev?ref_type=headsand confirm the branch commit is at the top. - Visit
/<project>/-/commits/dev?ref_type=tagsand confirm the tag's commit is at the top. - Visit
/<project>/-/commits/<sha>and confirm the SHA view still works with the pipeline column populated.
Edited by Jacques Erasmus

