Commit fccdf43f authored by Kassio Borges's avatar Kassio Borges

Import group with ndjson only if needed

parent cc08fb76
...@@ -36,7 +36,7 @@ module Groups ...@@ -36,7 +36,7 @@ module Groups
def restorer def restorer
@restorer ||= @restorer ||=
if ::Feature.enabled?(:group_import_export_ndjson, @group&.parent) if ndjson?
Gitlab::ImportExport::Group::TreeRestorer.new( Gitlab::ImportExport::Group::TreeRestorer.new(
user: @current_user, user: @current_user,
shared: @shared, shared: @shared,
...@@ -52,6 +52,11 @@ module Groups ...@@ -52,6 +52,11 @@ module Groups
end end
end end
def ndjson?
::Feature.enabled?(:group_import_export_ndjson, @group&.parent) &&
File.exist?(File.join(@shared.export_path, 'tree/groups/_all.ndjson'))
end
def remove_import_file def remove_import_file
upload = @group.import_export_upload upload = @group.import_export_upload
......
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