This instance was upgraded to Heptapod 0.27.2 on 2021-12-08 at 22:00 UTC+1

Commit e7451e84 authored by James Lopez's avatar James Lopez
Browse files

refactor project create service

parent 3a90762cdb4f
......@@ -639,7 +639,7 @@ def create_or_update_import_data(data: nil, credentials: nil)
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 @@ def save_project_and_import_data(import_data)
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 @@ def set_project_name_from_path
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