Commit 7a28e1c7 authored by Kerri Miller's avatar Kerri Miller

Extract #default_branch_from_preferences to handle settings lookup

parent 3326fc75
......@@ -76,7 +76,11 @@ module HasRepository
end
def default_branch
@default_branch ||= repository.root_ref || Gitlab::CurrentSettings.default_branch_name
@default_branch ||= repository.root_ref || default_branch_from_preferences
end
def default_branch_from_preferences
empty_repo? ? Gitlab::CurrentSettings.default_branch_name : nil
end
def reload_default_branch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment