gitlab-org--gitlab-foss/lib/gitlab/git_ref_validator.rb

13 lines
324 B
Ruby
Raw Normal View History

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(
2014-11-06 04:47:38 -05:00
%W(git check-ref-format refs/#{ref_name}))
end
end
end