summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-02-21 14:38:25 +0900
committerShinya Maeda <shinya@gitlab.com>2019-02-21 14:38:25 +0900
commitd89c6979e5ed16dfa5dfb3bdacdf609548ccd8ae (patch)
tree1e1958ccd81118922e7ea044cd0b999079161b88
parent5444b0a1fadf57cbbb2183001c53864421f8c0fc (diff)
downloadgitlab-ce-fix-remote-url-for-merge-request-pipelines.tar.gz
Fix remote url for merge request pipelinesfix-remote-url-for-merge-request-pipelines
-rw-r--r--app/models/ci/build.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 6b2b7e77180..f660c3f0ec1 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -480,7 +480,8 @@ module Ci
return unless token
auth = "gitlab-ci-token:#{token}@"
- project.http_url_to_repo.sub(%r{^https?://}) do |prefix|
+ target_project = if merge_request? ? merge_request.target_project : project
+ target_project.http_url_to_repo.sub(%r{^https?://}) do |prefix|
prefix + auth
end
end