gitlab-org--gitlab-foss/lib/gitlab/git_ref_validator.rb
Robert Schilling 551145bc98 Validate branch-names and references in WebUI, API
Add specs for GitRefValidator
2014-09-03 13:08:35 +02:00

11 lines
294 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)
system *%W(git check-ref-format refs/#{ref_name})
end
end
end