gitlab-org--gitlab-foss/lib/gitlab/git_ref_validator.rb
2015-11-03 17:11:09 -05:00

12 lines
350 B
Ruby

module Gitlab
module GitRefValidator
extend self
# Validates a given name against the git reference specification
#
# Returns true for a valid reference name, false otherwise
def validate(ref_name)
Gitlab::Utils.system_silent(
%W(#{Gitlab.config.git.bin_path} check-ref-format refs/#{ref_name}))
end
end
end