Find the EE branch by searching the branches
This uses a similar approach in ee_specific_check.rb
This commit is contained in:
parent
5bd8bfb66c
commit
e4047ad6f9
1 changed files with 20 additions and 8 deletions
|
@ -138,16 +138,24 @@ module Gitlab
|
|||
|
||||
def ee_branch_presence_check!
|
||||
ee_remotes.keys.each do |remote|
|
||||
[ce_branch, ee_branch_prefix, ee_branch_suffix].each do |branch|
|
||||
_, status = step("Fetching #{remote}/#{branch}", %W[git fetch #{remote} #{branch}])
|
||||
output, _ = step(
|
||||
"Searching #{remote}",
|
||||
%W[git ls-remote #{remote} *#{minimal_ee_branch_name}*])
|
||||
|
||||
branches =
|
||||
output.scan(%r{(?<=refs/heads/|refs/tags/).+}).sort_by(&:size)
|
||||
|
||||
next if branches.empty?
|
||||
|
||||
branch = branches.first
|
||||
|
||||
step("Fetching #{remote}/#{branch}", %W[git fetch #{remote} #{branch}])
|
||||
|
||||
if status.zero?
|
||||
@ee_remote_with_branch = remote
|
||||
@ee_branch_found = branch
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
puts
|
||||
puts ce_branch_doesnt_apply_cleanly_and_no_ee_branch_msg
|
||||
|
@ -271,6 +279,10 @@ module Gitlab
|
|||
@ee_patch_full_path ||= patches_dir.join(ee_patch_name)
|
||||
end
|
||||
|
||||
def minimal_ee_branch_name
|
||||
@minimal_ee_branch_name ||= ce_branch.sub(/(\Ace\-|\-ce\z)/, '')
|
||||
end
|
||||
|
||||
def patch_name_from_branch(branch_name)
|
||||
branch_name.parameterize << '.patch'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue