BigW Consortium Gitlab

attributes_at_ref_parser.rb 329 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
module Gitlab
  module Git
    # Parses root .gitattributes file at a given ref
    class AttributesAtRefParser
      delegate :attributes, to: :@parser

      def initialize(repository, ref)
        blob = repository.blob_at(ref, '.gitattributes')

        @parser = AttributesParser.new(blob&.data)
      end
    end
  end
end