summaryrefslogtreecommitdiff
path: root/app/models/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index da751591103..61c8dce6060 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -466,8 +466,8 @@ class Repository
return nil if !exists? || empty?
cache.fetch(:license_blob) do
- if licensee_project.license
- blob_at_branch(root_ref, licensee_project.matched_file.filename)
+ tree(:head).blobs.find do |file|
+ file.name =~ /\A(licen[sc]e|copying)(\..+|\z)/i
end
end
end
@@ -476,7 +476,7 @@ class Repository
return nil if !exists? || empty?
cache.fetch(:license_key) do
- licensee_project.license.try(:key) || 'no-license'
+ Licensee.license(path).try(:key)
end
end
@@ -959,8 +959,4 @@ class Repository
def cache
@cache ||= RepositoryCache.new(path_with_namespace)
end
-
- def licensee_project
- @licensee_project ||= Licensee.project(path)
- end
end