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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
27991525
Commit
27991525
authored
May 16, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue with forked MRs
parent
bd5b019a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+10
-2
No files found.
lib/gitlab/import_export/relation_factory.rb
View file @
27991525
...
@@ -53,11 +53,19 @@ module Gitlab
...
@@ -53,11 +53,19 @@ module Gitlab
def
update_project_references
(
relation_hash
,
klass
)
def
update_project_references
(
relation_hash
,
klass
)
project_id
=
relation_hash
.
delete
(
'project_id'
)
project_id
=
relation_hash
.
delete
(
'project_id'
)
if
relation_hash
[
'source_project_id'
]
&&
relation_hash
[
'target_project_id'
]
# If source and target are the same, populate them with the new project ID.
if
relation_hash
[
'target_project_id'
]
==
relation_hash
[
'source_project_id'
]
relation_hash
[
'source_project_id'
]
=
project_id
else
relation_hash
[
'source_project_id'
]
=
-
1
end
end
relation_hash
[
'target_project_id'
]
=
project_id
if
relation_hash
[
'target_project_id'
]
# project_id may not be part of the export, but we always need to populate it if required.
# project_id may not be part of the export, but we always need to populate it if required.
relation_hash
[
'project_id'
]
=
project_id
if
klass
.
column_names
.
include?
(
'project_id'
)
relation_hash
[
'project_id'
]
=
project_id
if
klass
.
column_names
.
include?
(
'project_id'
)
relation_hash
[
'gl_project_id'
]
=
project_id
if
relation_hash
[
'gl_project_id'
]
relation_hash
[
'gl_project_id'
]
=
project_id
if
relation_hash
[
'gl_project_id'
]
relation_hash
[
'target_project_id'
]
=
project_id
if
relation_hash
[
'target_project_id'
]
relation_hash
[
'source_project_id'
]
=
-
1
if
relation_hash
[
'source_project_id'
]
end
end
def
relation_class
(
relation_sym
)
def
relation_class
(
relation_sym
)
...
...
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