diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-23 14:49:48 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-23 14:49:48 +0300 |
commit | 6f7ce372921a322c48e659d8382a04895fd29b1f (patch) | |
tree | 16a94a546322a611a78c0e8ca0e93ce155c627c2 /lib | |
parent | d7eeb6df51ffe2ad864ef49d0e465b88ab158520 (diff) | |
parent | cd78e02096ffe210ede99f90d794ce4ba3f727c7 (diff) |
Merge branch 'fix-ee_compat_check-when-branch-contains-a-slash' into 'master'
Ensure we sanitize branch names with path-unfriendly characters
See merge request !7696
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ee_compat_check.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/ee_compat_check.rb b/lib/gitlab/ee_compat_check.rb index f4d1505ea91..c8e36d8ff4a 100644 --- a/lib/gitlab/ee_compat_check.rb +++ b/lib/gitlab/ee_compat_check.rb @@ -149,7 +149,7 @@ module Gitlab end def ce_patch_name - @ce_patch_name ||= "#{ce_branch}.patch" + @ce_patch_name ||= patch_name_from_branch(ce_branch) end def ce_patch_full_path @@ -161,13 +161,17 @@ module Gitlab end def ee_patch_name - @ee_patch_name ||= "#{ee_branch}.patch" + @ee_patch_name ||= patch_name_from_branch(ee_branch) end def ee_patch_full_path @ee_patch_full_path ||= patches_dir.join(ee_patch_name) end + def patch_name_from_branch(branch_name) + branch_name.parameterize << '.patch' + end + def step(desc, cmd = nil) puts "\n=> #{desc}\n" |