Module: Gitlab::GitRefValidator

Extended by:
GitRefValidator
Included in:
GitRefValidator
Defined in:
lib/gitlab/git_ref_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(ref_name) ⇒ Object

Validates a given name against the git reference specification

Returns true for a valid reference name, false otherwise


7
8
9
10
# File 'lib/gitlab/git_ref_validator.rb', line 7

def validate(ref_name)
  Gitlab::Utils.system_silent(
    %W(#{Gitlab.config.git.bin_path} check-ref-format refs/#{ref_name}))
end