Commit 2dea07dc authored by Lin Jen-Shin's avatar Lin Jen-Shin

Extract set_repository_size_limit_as_bytes

parent f7364440
......@@ -28,9 +28,6 @@ module Projects
return @project
end
# EE-only: Repository size limit comes as MB from the view
set_repository_size_limit_as_bytes
set_project_name_from_path
# get namespace id
......@@ -156,11 +153,6 @@ module Projects
end
end
def set_repository_size_limit_as_bytes
limit = params.delete(:repository_size_limit)
@project.repository_size_limit = Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
end
def set_project_name_from_path
# Set project name from path
if @project.name.present? && @project.path.present?
......
......@@ -4,11 +4,15 @@ module EE
def execute
raise NotImplementedError unless defined?(super)
limit = params.delete(:repository_size_limit)
mirror = params.delete(:mirror)
mirror_user_id = params.delete(:mirror_user_id)
mirror_trigger_builds = params.delete(:mirror_trigger_builds)
super do |project|
# Repository size limit comes as MB from the view
project.repository_size_limit = ::Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
if mirror && project.feature_available?(:repository_mirrors)
project.mirror = mirror unless mirror.nil?
project.mirror_trigger_builds = mirror_trigger_builds unless mirror_trigger_builds.nil?
......
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