Consider using a memorized variable when finding branches
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4859 we used a memorized variable when finding tags, which seemed to have a positive impact on performance. Consider doing the same for branches