debian-mirror-gitlab/lib/gitlab/git_ref_validator.rb

13 lines
350 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
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(
2015-11-26 14:37:03 +05:30
%W(#{Gitlab.config.git.bin_path} check-ref-format refs/#{ref_name}))
2015-04-26 12:48:37 +05:30
end
end
end