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:
authorGabriel Mazetto <brodock@gmail.com>2017-03-08 21:16:39 +0300
committerGabriel Mazetto <brodock@gmail.com>2017-03-08 21:42:21 +0300
commitce35dcbc81116fa4803fc7bfcd35a3585695c07a (patch)
treeb592e7170241c676fb9b98ebb54701ec5022a51a /lib
parent4a0cf269a60945938447160a1ec0aa40889aa24d (diff)
Refactor some code
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/pull_request_formatter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/pull_request_formatter.rb b/lib/gitlab/github_import/pull_request_formatter.rb
index e1224d03498..28812fd0cb9 100644
--- a/lib/gitlab/github_import/pull_request_formatter.rb
+++ b/lib/gitlab/github_import/pull_request_formatter.rb
@@ -38,8 +38,8 @@ module Gitlab
def source_branch_name
@source_branch_name ||= begin
- if source_branch.repo.id != target_branch.repo.id
- "pull/#{number}/#{source_branch.repo.full_name}/#{source_branch_ref}"
+ if cross_project?
+ "pull/#{number}/#{source_branch_repo.full_name}/#{source_branch_ref}"
else
source_branch_exists? ? source_branch_ref : "pull/#{number}/#{source_branch_ref}"
end
@@ -56,6 +56,10 @@ module Gitlab
end
end
+ def cross_project?
+ source_branch.repo.id != target_branch.repo.id
+ end
+
private
def state