2018-11-09 13:39:43 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-01-11 18:12:34 -05:00
|
|
|
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
|