Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e4047ad6
Commit
e4047ad6
authored
Jul 10, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Find the EE branch by searching the branches
This uses a similar approach in ee_specific_check.rb
parent
5bd8bfb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
lib/gitlab/ee_compat_check.rb
lib/gitlab/ee_compat_check.rb
+20
-8
No files found.
lib/gitlab/ee_compat_check.rb
View file @
e4047ad6
...
@@ -138,15 +138,23 @@ module Gitlab
...
@@ -138,15 +138,23 @@ module Gitlab
def
ee_branch_presence_check!
def
ee_branch_presence_check!
ee_remotes
.
keys
.
each
do
|
remote
|
ee_remotes
.
keys
.
each
do
|
remote
|
[
ce_branch
,
ee_branch_prefix
,
ee_branch_suffix
].
each
do
|
branch
|
output
,
_
=
step
(
_
,
status
=
step
(
"Fetching
#{
remote
}
/
#{
branch
}
"
,
%W[git fetch
#{
remote
}
#{
branch
}
]
)
"Searching
#{
remote
}
"
,
%W[git ls-remote
#{
remote
}
*
#{
minimal_ee_branch_name
}
*]
)
if
status
.
zero?
branches
=
@ee_remote_with_branch
=
remote
output
.
scan
(
%r{(?<=refs/heads/|refs/tags/).+}
).
sort_by
(
&
:size
)
@ee_branch_found
=
branch
return
true
next
if
branches
.
empty?
end
end
branch
=
branches
.
first
step
(
"Fetching
#{
remote
}
/
#{
branch
}
"
,
%W[git fetch
#{
remote
}
#{
branch
}
]
)
@ee_remote_with_branch
=
remote
@ee_branch_found
=
branch
return
true
end
end
puts
puts
...
@@ -271,6 +279,10 @@ module Gitlab
...
@@ -271,6 +279,10 @@ module Gitlab
@ee_patch_full_path
||=
patches_dir
.
join
(
ee_patch_name
)
@ee_patch_full_path
||=
patches_dir
.
join
(
ee_patch_name
)
end
end
def
minimal_ee_branch_name
@minimal_ee_branch_name
||=
ce_branch
.
sub
(
/(\Ace\-|\-ce\z)/
,
''
)
end
def
patch_name_from_branch
(
branch_name
)
def
patch_name_from_branch
(
branch_name
)
branch_name
.
parameterize
<<
'.patch'
branch_name
.
parameterize
<<
'.patch'
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment