Use HeadReference instead of GetDefaultBranch
HeadReference is a replacement for GetDefaultBranch. The intention is to replace and remove the default branch heuristic that GetDefaultBranch uses and instead rely solely on HEAD.
I'm only replacing occurrences that I consider safe here to get the ball rolling. I think ApplyPatch
and the commit service will require more thorough testing in gitlab-rails.
Edited by James Fargher