Skip to content

Add `Gitlab::CurrentSettings.default_branch_name` fallback to #default_branch

What does this MR do?

When a repository lacks a root_ref, fallback to whatever the application admin has set ApplicationSetting.default_branch_name to. This will impact primarily projects when the repo is empty.

Screenshots

_files_from_templates___GitLab_2020-07-07_13-13-19

These new file template links, with this change will point to [namespace]/-/new/[default_branch_name]

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Relates to #227271 (closed)

Edited by Kerri Miller

Merge request reports