Move `Gitlab::CurrentSettings.default_branch_name` check to HasRepository
We have at least 2 places in the app where we fetch the /idea/ of "default branch name" directly.
`Gitlab::CurrentSettings.default_branch_name` || "master"
Iteratively this made sense, but once a project is populated with it's own content and branches, it responds to #default_branch
(https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/concerns/has_repository.rb#L78-80). Instead of returning nil
, should it instead return Gitlab::CurrentSettings.default_branch_name
?
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/221013
Edited by Kerri Miller