Repository branch selector not showing branch icon

Context

The branch / ref selector component is supposed to have an icon next to the ref name. In the Repository page, the icon is missing. However, in the Commit page, the branch selector still has the icon.

Repository page Commit page
repo.png commit.png

In a previous iteration !193724 (merged), the branch selector appears as intended. This may be a bug or regression.

Note, this problem goes away, as soon as you select a different ref using the buggy link above.

Technical notes

The logic to determine the dropdown icon is based on selectedRef in ref_selector. In this case, we got into a state that we do not have branch in the selectedRef . This value seems to be initiated from the vuex store.

On further inspection it was noted this only happens when the ref_type isn't specified in the URL. The backend only used the ref_type if it's supplied but didn't attempt to infer the ref_type from the ref. We already check for ambiguous refs when this happens so we should be detecting the ref type too.

Edited by 🤖 GitLab Bot 🤖