Commit f31fb4cd authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '40186-the-ee_compat_check-job-sometimes-fail-on-the-git-apply-3way-step-for-forks' into 'master'

Always fetch master from the canonical remote

Closes #40186

See merge request gitlab-org/gitlab-ce!15399
parents 7b34d828 54533920
......@@ -193,7 +193,7 @@ module Gitlab
# Repository is initially cloned with a depth of 20 so we need to fetch
# deeper in the case the branch has more than 20 commits on top of master
fetch(branch: branch, depth: depth)
fetch(branch: 'master', depth: depth)
fetch(branch: 'master', depth: depth, remote: DEFAULT_CE_PROJECT_URL)
merge_base_found?
end
......@@ -201,10 +201,10 @@ module Gitlab
raise "\n#{branch} is too far behind master, please rebase it!\n" unless success
end
def fetch(branch:, depth:)
def fetch(branch:, depth:, remote: 'origin')
step(
"Fetching deeper...",
%W[git fetch --depth=#{depth} --prune origin +refs/heads/#{branch}:refs/remotes/origin/#{branch}]
%W[git fetch --depth=#{depth} --prune #{remote} +refs/heads/#{branch}:refs/remotes/origin/#{branch}]
) do |output, status|
raise "Fetch failed: #{output}" unless status.zero?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment