summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_ref_validator.rb
blob: 13cb08948bb71bad53bc9bddc2a14f09471a7962 (plain)
1
2
3
4
5
6
7
8
9
10
11
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