diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/services/packages/composer/version_parser_service.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/services/packages/composer/version_parser_service.rb')
-rw-r--r-- | app/services/packages/composer/version_parser_service.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/services/packages/composer/version_parser_service.rb b/app/services/packages/composer/version_parser_service.rb index 36275d1b680..516c306d2a5 100644 --- a/app/services/packages/composer/version_parser_service.rb +++ b/app/services/packages/composer/version_parser_service.rb @@ -12,18 +12,19 @@ module Packages if @tag_name.present? @tag_name.delete_prefix('v') elsif @branch_name.present? - branch_sufix_or_prefix(@branch_name.match(Gitlab::Regex.composer_package_version_regex)) + branch_suffix_or_prefix(@branch_name.match(Gitlab::Regex.composer_package_version_regex)) end end private - def branch_sufix_or_prefix(match) + def branch_suffix_or_prefix(match) if match - if match.captures[1] == '.x' - match.captures[0] + '-dev' + captures = match.captures.reject(&:blank?) + if captures[-1] == '.x' + captures[0] + '-dev' else - match.captures[0] + '.x-dev' + captures[0] + '.x-dev' end else "dev-#{@branch_name}" |