diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2017-11-21 19:00:05 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-21 19:00:05 +0000 |
commit | 00cd5d93ce2245204356cf550871cfb96ea7dc8e (patch) | |
tree | d7d1ec5e66c65ba23cb3f436d78269e058601e8e /app | |
parent | 2822254ec5e6b27e092d2f850b48fd165f9424a0 (diff) | |
download | gitlab-ce-00cd5d93ce2245204356cf550871cfb96ea7dc8e.tar.gz |
Use Redis cache for branch existence checks
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 26d1bc12232..2bf21cbdcc4 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -217,11 +217,7 @@ class Repository def branch_exists?(branch_name) return false unless raw_repository - @branch_exists_memo ||= Hash.new do |hash, key| - hash[key] = raw_repository.branch_exists?(key) - end - - @branch_exists_memo[branch_name] + branch_names.include?(branch_name) end def ref_exists?(ref) |