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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5c59ba35
Commit
5c59ba35
authored
May 11, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix complexity of method
parent
68aca6f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+19
-11
No files found.
app/services/projects/create_service.rb
View file @
5c59ba35
...
@@ -50,18 +50,9 @@ module Projects
...
@@ -50,18 +50,9 @@ module Projects
@project
.
build_forked_project_link
(
forked_from_project_id:
forked_from_project_id
)
@project
.
build_forked_project_link
(
forked_from_project_id:
forked_from_project_id
)
end
end
Project
.
transaction
do
process_import_data
(
import_data
)
@project
.
create_or_update_import_data
(
data:
import_data
[
:data
],
credentials:
import_data
[
:credentials
])
if
import_data
@project
.
save
if
@project
.
persisted?
&&
!
@project
.
import?
raise
'Failed to create repository'
unless
@project
.
create_repository
end
end
Project
.
transaction
do
start_import
if
@project
.
import?
@project
.
import_start
if
@project
.
import?
end
after_create_actions
if
@project
.
persisted?
after_create_actions
if
@project
.
persisted?
...
@@ -100,5 +91,22 @@ module Projects
...
@@ -100,5 +91,22 @@ module Projects
@project
.
team
<<
[
current_user
,
:master
,
current_user
]
@project
.
team
<<
[
current_user
,
:master
,
current_user
]
end
end
end
end
def
start_import
Project
.
transaction
do
@project
.
import_start
end
end
def
process_import_data
(
import_data
)
Project
.
transaction
do
@project
.
create_or_update_import_data
(
data:
import_data
[
:data
],
credentials:
import_data
[
:credentials
])
if
import_data
@project
.
save
if
@project
.
persisted?
&&
!
@project
.
import?
raise
'Failed to create repository'
unless
@project
.
create_repository
end
end
end
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