Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-09-06 11:16:11 +0300
committerJames Lopez <james@jameslopez.es>2017-09-06 11:16:11 +0300
commite5f91e524628faab81c1d61ebcaa00eaf0954ff6 (patch)
tree691f7d5ce52b61ccc6d6e0d9373a1eee15993bed /lib
parent89ca01eb1a2eac5472f3957bb425700dcac82a7a (diff)
refactor code based on feedback
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index 4c17f13b851..dec8a4c8cab 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -53,11 +53,9 @@ module Gitlab
# Finally, it updates each attribute in the newly imported project.
def create_relations
default_relation_list.each do |relation|
- next unless relation.is_a?(Hash) || @tree_hash[relation.to_s].present?
-
if relation.is_a?(Hash)
create_sub_relations(relation, @tree_hash)
- else
+ elsif @tree_hash[relation.to_s].present?
relation_key = relation.is_a?(Hash) ? relation.keys.first : relation
save_relation_hash(@tree_hash[relation_key.to_s], relation_key)
end