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:
authorGokmen Goksel <gokmen@goksel.me>2016-08-02 22:32:36 +0300
committerMark Pundsack <markpundsack@users.noreply.github.com>2016-08-03 22:12:42 +0300
commitbfa85e27c8539ce5271eb422ca57e5d3be6d34b1 (patch)
tree8e2a5a25356f322d63fd4299d84a478581551012
parent81ccd489146a7ce0b158c7ec1d894d33bbcf71f1 (diff)
Repository: use cache for koding_yml file check
-rw-r--r--app/models/repository.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 5e068f1f2c9..3da5c2fad74 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -277,7 +277,7 @@ class Repository
def cache_keys
%i(size commit_count
readme version contribution_guide changelog
- license_blob license_key gitignore)
+ license_blob license_key gitignore koding_yml)
end
# Keys for data on branch/tag operations.
@@ -538,10 +538,10 @@ class Repository
end
def koding_yml
- return nil if !exists? || empty?
+ return nil unless head_exists?
- @koding_yml ||= tree(:head).blobs.find do |file|
- file.name == Gitlab.config.koding.file
+ cache.fetch(:koding_yml) do
+ file_on_head(/\A#{Regexp.escape(Gitlab.config.koding.file)}/)
end
end