diff options
-rw-r--r-- | lib/gitlab/push_options.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/gitlab/push_options.rb b/lib/gitlab/push_options.rb index a2296d265cd..93c0f3132d0 100644 --- a/lib/gitlab/push_options.rb +++ b/lib/gitlab/push_options.rb @@ -56,19 +56,23 @@ module Gitlab next if [namespace, key].any?(&:nil?) - options[namespace] ||= HashWithIndifferentAccess.new - - if option_multi_value?(namespace, key) - options[namespace][key] ||= HashWithIndifferentAccess.new(0) - options[namespace][key][value] += 1 - else - options[namespace][key] = value - end + store_option_info(options, namespace, key, value) end options end + def store_option_info(options, namespace, key, value) + options[namespace] ||= HashWithIndifferentAccess.new + + if option_multi_value?(namespace, key) + options[namespace][key] ||= HashWithIndifferentAccess.new(0) + options[namespace][key][value] += 1 + else + options[namespace][key] = value + end + end + def option_multi_value?(namespace, key) MULTI_VALUE_OPTIONS.any? { |arr| arr == [namespace, key] } end |