summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-20 22:11:20 +0000
committerRobert Speicher <robert@gitlab.com>2016-01-20 22:11:20 +0000
commit3e7092a83ab0fc6cb259627c8ecc0e259f77ca7c (patch)
tree4459b9f7ff3f8035517a673d7aaa40fb5e717bda /lib
parent348129d021555225f17561ddc7f175a3a55923d2 (diff)
parentf4bdbecfd54c39baed79d0143de97933d26e3215 (diff)
downloadgitlab-ce-3e7092a83ab0fc6cb259627c8ecc0e259f77ca7c.tar.gz
Merge branch 'fix-github-pull-requests-import' into 'master'
Fix cross projects detection when importing GitHub pull requests Fixes #12456 See merge request !2523
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/pull_request_formatter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/pull_request_formatter.rb b/lib/gitlab/github_import/pull_request_formatter.rb
index b7c47958cc7..f96fed0f5cf 100644
--- a/lib/gitlab/github_import/pull_request_formatter.rb
+++ b/lib/gitlab/github_import/pull_request_formatter.rb
@@ -18,7 +18,7 @@ module Gitlab
end
def cross_project?
- source_repo.fork == true
+ source_repo.id != target_repo.id
end
def number
@@ -73,6 +73,10 @@ module Gitlab
project
end
+ def target_repo
+ raw_data.base.repo
+ end
+
def target_branch
target_project.repository.find_branch(raw_data.base.ref)
end