diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-17 20:37:50 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-18 18:17:43 +0300 |
commit | b1b8261f56d35e471bc32b0f2050e27650b7c797 (patch) | |
tree | 2fed6bd1da292a8348b838b208fad812bf500764 /app/models/repository.rb | |
parent | 5adb1128dcca2810a32b7b974372970c6d36a98c (diff) |
Add license and contribution guide links to project sidebar.
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 8d0306e820d..86c9c9b4d48 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -122,7 +122,7 @@ class Repository def expire_cache %i(size branch_names tag_names commit_count graph_log - readme version contribution_guide changelog).each do |key| + readme version contribution_guide changelog license).each do |key| cache.expire(key) end end @@ -212,6 +212,14 @@ class Repository end end + def license + cache.fetch(:license) do + tree(:head).blobs.find do |file| + file.name =~ /^license/i + end + end + end + def head_commit commit(self.root_ref) end |