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 ...@@ -193,7 +193,7 @@ module Gitlab
# Repository is initially cloned with a depth of 20 so we need to fetch # 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 # deeper in the case the branch has more than 20 commits on top of master
fetch(branch: branch, depth: depth) fetch(branch: branch, depth: depth)
fetch(branch: 'master', depth: depth) fetch(branch: 'master', depth: depth, remote: DEFAULT_CE_PROJECT_URL)
merge_base_found? merge_base_found?
end end
...@@ -201,10 +201,10 @@ module Gitlab ...@@ -201,10 +201,10 @@ module Gitlab
raise "\n#{branch} is too far behind master, please rebase it!\n" unless success raise "\n#{branch} is too far behind master, please rebase it!\n" unless success
end end
def fetch(branch:, depth:) def fetch(branch:, depth:, remote: 'origin')
step( step(
"Fetching deeper...", "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| ) do |output, status|
raise "Fetch failed: #{output}" unless status.zero? raise "Fetch failed: #{output}" unless status.zero?
end 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