diff options
Diffstat (limited to 'app/models/ref_matcher.rb')
-rw-r--r-- | app/models/ref_matcher.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/ref_matcher.rb b/app/models/ref_matcher.rb index fa7d2c0f06c..46f4ce0ecc7 100644 --- a/app/models/ref_matcher.rb +++ b/app/models/ref_matcher.rb @@ -5,10 +5,10 @@ class RefMatcher @ref_name_or_pattern = ref_name_or_pattern end - # Returns all branches/tags (among the given list of refs [`Gitlab::Git::Branch`]) + # Returns all branches/tags (among the given list of refs [`Gitlab::Git::Branch`] or their names [`String`]) # that match the current protected ref. def matching(refs) - refs.select { |ref| matches?(ref.name) } + refs.select { |ref| ref.is_a?(String) ? matches?(ref) : matches?(ref.name) } end # Checks if the protected ref matches the given ref name. |