Commit 58492534 authored by Yorick Peterse's avatar Yorick Peterse

Restore GitRefValidator per CE

EE contained various cosmetic changes that behave the same way as in CE,
they just look different. This restores the file per CE, ensuring both
CE and EE use the same code.
parent 0fe56995
......@@ -6,15 +6,14 @@ module Gitlab
module GitRefValidator
extend self
EXPANDED_PREFIXES = %w(refs/heads/ refs/remotes/).freeze
DISALLOWED_PREFIXES = %w(-).freeze
EXPANDED_PREFIXES = %w[refs/heads/ refs/remotes/].freeze
DISALLOWED_PREFIXES = %w[-].freeze
# Validates a given name against the git reference specification
#
# Returns true for a valid reference name, false otherwise
def validate(ref_name)
return false if ref_name.start_with?(*EXPANDED_PREFIXES)
return false if ref_name.start_with?(*DISALLOWED_PREFIXES)
return false if ref_name.start_with?(*(EXPANDED_PREFIXES + DISALLOWED_PREFIXES))
return false if ref_name == 'HEAD'
begin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment