Branches selector is loaded synchronously and twice on commits page
If you (for some reason) have a few thousand branches, you're loading every single one twice to display the commit page:
For GitLab CE,
390 branches * 2 dropdowns = 780 options that need to be rendered, that's quite a few.
That's bad for performance both backend and frontend, especially since these are loaded for the cherry pick and revert dialogs, two dialogs which are used on <1% of page loads (good features, just not frequently used features!).
We should load the branches data asynchronously - only when the branch selector is actually opened - like in !4508 (merged).
@iamphill would it be possible to make a helper for branches/tags dropdowns since we currently use them in a few different places? Maybe with the ability to pass
branches_and_tags into it depending on what's necessary?