From 0657002251a48e39849204b6eed8e633bee32563 Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Thu, 14 Sep 2017 10:48:12 +0200 Subject: Restore has_visible_content? to improve performance (cache) This method was moved to ::Git but it is not cached there which causes performance problems --- app/models/repository.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/models/repository.rb b/app/models/repository.rb index 035f85a0b46..6ed33e0c268 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -90,6 +90,12 @@ class Repository ) end + # we need to have this method here because it is not cached in ::Git and + # the method is called multiple times for every request + def has_visible_content? + branch_count > 0 + end + def inspect "#<#{self.class.name}:#{@disk_path}>" end -- cgit v1.2.1