summaryrefslogtreecommitdiff
path: root/app/models/concerns/blob_language_from_git_attributes.rb
blob: 56e1276a220c4b79d9e918cae83a3227b34340e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

# Applicable for blob classes with project attribute
module BlobLanguageFromGitAttributes
  extend ActiveSupport::Concern

  def language_from_gitattributes
    return unless project

    repository = project.repository
    repository.gitattribute(path, 'gitlab-language')
  end
end