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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
d91dd2f5
Commit
d91dd2f5
authored
Jan 23, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract set_project_name_from_path method
parent
ae057666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+15
-11
No files found.
app/services/projects/create_service.rb
View file @
d91dd2f5
...
...
@@ -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
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