summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/project/tree_saver.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
commit0c872e02b2c822e3397515ec324051ff540f0cd5 (patch)
treece2fb6ce7030e4dad0f4118d21ab6453e5938cdd /lib/gitlab/import_export/project/tree_saver.rb
parentf7e05a6853b12f02911494c4b3fe53d9540d74fc (diff)
downloadgitlab-ce-15.7.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'lib/gitlab/import_export/project/tree_saver.rb')
-rw-r--r--lib/gitlab/import_export/project/tree_saver.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/gitlab/import_export/project/tree_saver.rb b/lib/gitlab/import_export/project/tree_saver.rb
index bd34cd3ff6e..05b96f7e8ce 100644
--- a/lib/gitlab/import_export/project/tree_saver.rb
+++ b/lib/gitlab/import_export/project/tree_saver.rb
@@ -81,15 +81,13 @@ module Gitlab
end
def json_writer
- @json_writer ||= begin
- if ::Feature.enabled?(:project_export_as_ndjson, @project.namespace)
- full_path = File.join(@shared.export_path, 'tree')
- Gitlab::ImportExport::Json::NdjsonWriter.new(full_path)
- else
- full_path = File.join(@shared.export_path, ImportExport.project_filename)
- Gitlab::ImportExport::Json::LegacyWriter.new(full_path, allowed_path: 'project')
- end
- end
+ @json_writer ||= if ::Feature.enabled?(:project_export_as_ndjson, @project.namespace)
+ full_path = File.join(@shared.export_path, 'tree')
+ Gitlab::ImportExport::Json::NdjsonWriter.new(full_path)
+ else
+ full_path = File.join(@shared.export_path, ImportExport.project_filename)
+ Gitlab::ImportExport::Json::LegacyWriter.new(full_path, allowed_path: 'project')
+ end
end
end
end