Commit 86257cf7 authored by James Lopez's avatar James Lopez

refactor project create service

parent 80112ca4
...@@ -639,7 +639,7 @@ class Project < ActiveRecord::Base ...@@ -639,7 +639,7 @@ class Project < ActiveRecord::Base
end end
def import? def import?
external_import? || forked? || gitlab_project_import? external_import? || forked? || gitlab_project_import? || bare_repository_import?
end end
def no_import? def no_import?
......
...@@ -120,7 +120,7 @@ module Projects ...@@ -120,7 +120,7 @@ module Projects
Project.transaction do Project.transaction do
@project.create_or_update_import_data(data: import_data[:data], credentials: import_data[:credentials]) if import_data @project.create_or_update_import_data(data: import_data[:data], credentials: import_data[:credentials]) if import_data
if @project.save && !@project.import? && !@project.bare_repository_import? if @project.save && !@project.import?
raise 'Failed to create repository' unless @project.create_repository raise 'Failed to create repository' unless @project.create_repository
end end
end end
...@@ -165,7 +165,7 @@ module Projects ...@@ -165,7 +165,7 @@ module Projects
def import_schedule def import_schedule
if @project.errors.empty? if @project.errors.empty?
@project.import_schedule if @project.import? @project.import_schedule if @project.import? && !@project.bare_repository_import?
else else
fail(error: @project.errors.full_messages.join(', ')) fail(error: @project.errors.full_messages.join(', '))
end end
......
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