Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-17 20:37:50 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-18 18:17:43 +0300
commitb1b8261f56d35e471bc32b0f2050e27650b7c797 (patch)
tree2fed6bd1da292a8348b838b208fad812bf500764 /app/models/repository.rb
parent5adb1128dcca2810a32b7b974372970c6d36a98c (diff)
Add license and contribution guide links to project sidebar.
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb10
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