Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2dea07dc
Commit
2dea07dc
authored
Sep 05, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract set_repository_size_limit_as_bytes
parent
f7364440
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+0
-8
ee/app/services/ee/projects/create_service.rb
ee/app/services/ee/projects/create_service.rb
+4
-0
No files found.
app/services/projects/create_service.rb
View file @
2dea07dc
...
...
@@ -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?
...
...
ee/app/services/ee/projects/create_service.rb
View file @
2dea07dc
...
...
@@ -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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment