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
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/pull_request_formatter.rb')
-rw-r--r--lib/gitlab/github_import/pull_request_formatter.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/pull_request_formatter.rb b/lib/gitlab/github_import/pull_request_formatter.rb
index 4ea0200e89b..28812fd0cb9 100644
--- a/lib/gitlab/github_import/pull_request_formatter.rb
+++ b/lib/gitlab/github_import/pull_request_formatter.rb
@@ -38,7 +38,11 @@ module Gitlab
def source_branch_name
@source_branch_name ||= begin
- source_branch_exists? ? source_branch_ref : "pull/#{number}/#{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
end
end
@@ -52,6 +56,10 @@ module Gitlab
end
end
+ def cross_project?
+ source_branch.repo.id != target_branch.repo.id
+ end
+
private
def state