BigW Consortium Gitlab

git_ref_validator.rb 350 Bytes
Newer Older
1 2 3 4 5 6 7
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)
8
      Gitlab::Utils.system_silent(
9
        %W(#{Gitlab.config.git.bin_path} check-ref-format refs/#{ref_name}))
10 11 12
    end
  end
end