Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/branches/create_service.rb')
-rw-r--r--app/services/branches/create_service.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/branches/create_service.rb b/app/services/branches/create_service.rb
index 8684da701db..848e6aaa65a 100644
--- a/app/services/branches/create_service.rb
+++ b/app/services/branches/create_service.rb
@@ -2,8 +2,8 @@
module Branches
class CreateService < BaseService
- def execute(branch_name, ref, create_master_if_empty: true)
- create_master_branch if create_master_if_empty && project.empty_repo?
+ def execute(branch_name, ref, create_default_branch_if_empty: true)
+ create_default_branch if create_default_branch_if_empty && project.empty_repo?
result = ::Branches::ValidateNewService.new(project).execute(branch_name)
@@ -27,13 +27,13 @@ module Branches
private
- def create_master_branch
+ def create_default_branch
project.repository.create_file(
current_user,
'/README.md',
'',
message: 'Add README.md',
- branch_name: 'master'
+ branch_name: project.default_branch_or_main
)
end
end