diff options
Diffstat (limited to 'lib/gitlab/import_export/json/ndjson_reader.rb')
-rw-r--r-- | lib/gitlab/import_export/json/ndjson_reader.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/gitlab/import_export/json/ndjson_reader.rb b/lib/gitlab/import_export/json/ndjson_reader.rb index 93a94716f8d..3de56aacf18 100644 --- a/lib/gitlab/import_export/json/ndjson_reader.rb +++ b/lib/gitlab/import_export/json/ndjson_reader.rb @@ -21,9 +21,7 @@ module Gitlab # This reads from `tree/project.json` path = file_path("#{importable_path}.json") - if !File.exist?(path) || Gitlab::Utils::FileInfo.linked?(path) - raise Gitlab::ImportExport::Error, 'Invalid file' - end + raise Gitlab::ImportExport::Error, 'Invalid file' if !File.exist?(path) || File.symlink?(path) data = File.read(path, MAX_JSON_DOCUMENT_SIZE) json_decode(data) @@ -36,7 +34,7 @@ module Gitlab # This reads from `tree/project/merge_requests.ndjson` path = file_path(importable_path, "#{key}.ndjson") - next if !File.exist?(path) || Gitlab::Utils::FileInfo.linked?(path) + next if !File.exist?(path) || File.symlink?(path) File.foreach(path, MAX_JSON_DOCUMENT_SIZE).with_index do |line, line_num| documents << [json_decode(line), line_num] |