Impossible to browse a branch if a tag exists with the same name.
Summary
If your repo contains a branch and a tag with the same name, the UI does not allow you to browse the branch.
Steps to reproduce
- Create a repo with a branch and a tag having the same name.
- Browse to the repo.
- Attempt to view the branch.
Example Project
https://gitlab.com/abliss/bugdemo
I first created a branch named TagBranch through the UI, editing a file. abliss/bugdemo@12806f81
Then I created another commit, on a new branch, named Tmp (also by editing a file in the ui). abliss/bugdemo@fc093cfc
Then I created a Tag named TagBranch, pointing to Tmp.
What is the current bug behavior?
If you click on Branches and then TagBranch, it takes you here: https://gitlab.com/abliss/bugdemo/tree/TagBranch
But instead of showing the branch you clicked on, it shows you the Tag of the same name.
If you try to use the "Branches" dropdown, you will see that it contains both the branch and the tag, and they both have checkmarks. Which might make you think that you are viewing both and they are the same, but this is not true. If you try to click on either of the entries in the dropdown, weird things start to happen, but you never end up viewing the branch.
What is the expected correct behavior?
Clicking on Branches -> TagBranch should show you the correct commit (12806). Same for clicking in the "Branches" dropdown. And the "Branches" dropdown should have a checkmark next to only ONE of the branch/tag, corresponding to the one you're currently viewing.
This may be difficult given that the url slug, https://gitlab.com/abliss/bugdemo/tree/TagBranch , does not have any room to distinguish between tags and branches.
Output of checks
This bug happens on GitLab.com
Possible fixes
I would suggest that the url slug should contain the entire ref name (refs/heads/TagBranch or refs/tags/TagBranch). But maybe you only do this when you've detected the repo contains a conflict?
As an interesting side-note, Github.com has the exact opposite bug: it's impossible to browse to the tag, and you can only see the branch.