diff --git a/lib/gitlab/push_options.rb b/lib/gitlab/push_options.rb index a2296d265cd9893430c45b6d6ecacff36e6356ae..93c0f3132d0a86a498a5960115cf27c63a267e55 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