summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-01-23 16:41:30 -0200
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-01-23 16:41:43 -0200
commitd91dd2f58d7cbcc9032efea2e67f4c2e5afa3364 (patch)
treecddc9581cc2f2b8de71242c2837ba837fca07691
parentae057666bf9894660ce1cb480595f2686f1d9ae5 (diff)
downloadgitlab-ce-backport-ee-1067-deal-with-repo-size-limit-as-byte.tar.gz
Extract set_project_name_from_path methodbackport-ee-1067-deal-with-repo-size-limit-as-byte
-rw-r--r--app/services/projects/create_service.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 159f46cd465..c7cce0c55b9 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -22,17 +22,7 @@ module Projects
return @project
end
- # Set project name from path
- if @project.name.present? && @project.path.present?
- # if both name and path set - everything is ok
- elsif @project.path.present?
- # Set project name from path
- @project.name = @project.path.dup
- elsif @project.name.present?
- # For compatibility - set path from name
- # TODO: remove this in 8.0
- @project.path = @project.name.dup.parameterize
- end
+ set_project_name_from_path
# get namespace id
namespace_id = params[:namespace_id]
@@ -144,5 +134,19 @@ module Projects
service.save!
end
end
+
+ def set_project_name_from_path
+ # Set project name from path
+ if @project.name.present? && @project.path.present?
+ # if both name and path set - everything is ok
+ elsif @project.path.present?
+ # Set project name from path
+ @project.name = @project.path.dup
+ elsif @project.name.present?
+ # For compatibility - set path from name
+ # TODO: remove this in 8.0
+ @project.path = @project.name.dup.parameterize
+ end
+ end
end
end