summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/project_tree_restorer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/import_export/project_tree_restorer.rb')
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index 5a109f24f9f..7cdba880a93 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -110,7 +110,7 @@ module Gitlab
def create_relation(relation, relation_hash_list)
relation_array = [relation_hash_list].flatten.map do |relation_hash|
Gitlab::ImportExport::RelationFactory.create(relation_sym: relation.to_sym,
- relation_hash: relation_hash,
+ relation_hash: parsed_relation_hash(relation_hash),
members_mapper: members_mapper,
user: @user,
project_id: restored_project.id)
@@ -118,6 +118,10 @@ module Gitlab
relation_hash_list.is_a?(Array) ? relation_array : relation_array.first
end
+
+ def parsed_relation_hash(relation_hash)
+ relation_hash.merge!('group_id' => restored_project.group.try(:id), 'project_id' => restored_project.id)
+ end
end
end
end