diff options
author | Gokmen Goksel <gokmen@goksel.me> | 2016-08-02 22:32:36 +0300 |
---|---|---|
committer | Mark Pundsack <markpundsack@users.noreply.github.com> | 2016-08-03 12:12:42 -0700 |
commit | bfa85e27c8539ce5271eb422ca57e5d3be6d34b1 (patch) | |
tree | 8e2a5a25356f322d63fd4299d84a478581551012 | |
parent | 81ccd489146a7ce0b158c7ec1d894d33bbcf71f1 (diff) | |
download | gitlab-ce-bfa85e27c8539ce5271eb422ca57e5d3be6d34b1.tar.gz |
Repository: use cache for koding_yml file check
-rw-r--r-- | app/models/repository.rb | 8 |
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 |