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

refactor project create service

parent 80112ca4
......@@ -639,7 +639,7 @@ class Project < ActiveRecord::Base
end
def import?
external_import? || forked? || gitlab_project_import?
external_import? || forked? || gitlab_project_import? || bare_repository_import?
end
def no_import?
......
......@@ -120,7 +120,7 @@ module Projects
Project.transaction do
@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
end
end
......@@ -165,7 +165,7 @@ module Projects
def import_schedule
if @project.errors.empty?
@project.import_schedule if @project.import?
@project.import_schedule if @project.import? && !@project.bare_repository_import?
else
fail(error: @project.errors.full_messages.join(', '))
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