Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a54c50d1
Commit
a54c50d1
authored
Sep 03, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove relation after used from the hash tree
parent
025a2688
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+3
-6
No files found.
lib/gitlab/import_export/project_tree_restorer.rb
View file @
a54c50d1
...
@@ -57,7 +57,7 @@ module Gitlab
...
@@ -57,7 +57,7 @@ module Gitlab
else
else
relation_key
=
relation
.
is_a?
(
Hash
)
?
relation
.
keys
.
first
:
relation
relation_key
=
relation
.
is_a?
(
Hash
)
?
relation
.
keys
.
first
:
relation
relation_hash_list
=
@tree_hash
[
relation_key
.
to_s
]
relation_hash_list
=
@tree_hash
[
relation_key
.
to_s
]
save_relation_hash
(
relation_hash_list
,
relation_key
,
saved
)
save_relation_hash
(
relation_hash_list
,
relation_key
,
@
saved
)
end
end
...
@@ -82,10 +82,7 @@ module Gitlab
...
@@ -82,10 +82,7 @@ module Gitlab
relation_hash
=
create_relation
(
relation_key
,
relation_hash_batch
)
relation_hash
=
create_relation
(
relation_key
,
relation_hash_batch
)
@saved
<<
restored_project
.
append_or_update_attribute
(
relation_key
,
relation_hash
)
@saved
<<
restored_project
.
append_or_update_attribute
(
relation_key
,
relation_hash
)
@restored_project
=
nil
@restored_project
=
Project
.
find_by_id
(
@project_id
)
@project
=
nil
@project
=
Project
.
find_by_id
(
@project_id
)
end
end
def
default_relation_list
def
default_relation_list
...
@@ -117,7 +114,6 @@ module Gitlab
...
@@ -117,7 +114,6 @@ module Gitlab
#
#
# Recursively calls this method if the sub-relation is a hash containing more sub-relations
# Recursively calls this method if the sub-relation is a hash containing more sub-relations
def
create_sub_relations
(
relation
,
tree_hash
,
save
=
true
)
def
create_sub_relations
(
relation
,
tree_hash
,
save
=
true
)
tree_hash
=
tree_hash
.
dup
relation_key
=
relation
.
keys
.
first
.
to_s
relation_key
=
relation
.
keys
.
first
.
to_s
return
if
tree_hash
[
relation_key
].
blank?
return
if
tree_hash
[
relation_key
].
blank?
...
@@ -133,6 +129,7 @@ module Gitlab
...
@@ -133,6 +129,7 @@ module Gitlab
end
end
save_relation_hash
([
relation_item
],
relation_key
)
if
save
save_relation_hash
([
relation_item
],
relation_key
)
if
save
tree_hash
.
delete
(
relation_key
)
if
save
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment