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
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-11-21 22:00:05 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-11-23 04:39:15 +0300
commit400e3ddc3561ac97875013dc4d7ca84c53731501 (patch)
tree550afb632b5447f2ab63154ea814c25060895c9e /app
parent3fba216ce103cedc9979c636944a67cf757f7617 (diff)
Merge branch 'branch-exists-redis' into 'master'
Use Redis cache for branch existence checks Closes #40349 See merge request gitlab-org/gitlab-ce!15513 (cherry picked from commit e2e4d18f1c468db8d76aaea1eb1d8442b196244b) 82e9bf29 Use Redis cache for branch existence checks 59fbefbd Add caching test 595631d2 refactor tests f3156232 apply Rémy's patch
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 3a6afc117a6..8c76a3a5dc5 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)