Commit 7ed935b6765ed1e9de810cfdf8ac9f6eb3fb741d

Authored by Dmitriy Zaporozhets
1 parent 5b219355

Use gitlab_git to get commit_count in repo. It allows get commits count for git …

…repos with 100k+ commits

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Gemfile
... ... @@ -30,7 +30,7 @@ gem &#39;omniauth-github&#39;
30 30  
31 31 # Extracting information from a git repository
32 32 # Provide access to Gitlab::Git library
33   -gem "gitlab_git", '~> 5.8'
  33 +gem "gitlab_git", '~> 6.0'
34 34  
35 35 # Ruby/Rack Git Smart-HTTP Server Handler
36 36 gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
... ...
Gemfile.lock
... ... @@ -175,7 +175,7 @@ GEM
175 175 mime-types (~> 1.19)
176 176 gitlab_emoji (0.0.1.1)
177 177 emoji (~> 1.0.1)
178   - gitlab_git (5.9.0)
  178 + gitlab_git (6.0.0)
179 179 activesupport (~> 4.0)
180 180 charlock_holmes (~> 0.6)
181 181 gitlab-grit (~> 2.6)
... ... @@ -601,7 +601,7 @@ DEPENDENCIES
601 601 gitlab-grack (~> 2.0.0.pre)
602 602 gitlab-linguist (~> 3.0.0)
603 603 gitlab_emoji (~> 0.0.1.1)
604   - gitlab_git (~> 5.8)
  604 + gitlab_git (~> 6.0)
605 605 gitlab_meta (= 6.0)
606 606 gitlab_omniauth-ldap (= 1.0.4)
607 607 gollum-lib (~> 3.0.0)
... ...
app/models/repository.rb
... ... @@ -106,7 +106,7 @@ class Repository
106 106 def commit_count
107 107 Rails.cache.fetch(cache_key(:commit_count)) do
108 108 begin
109   - raw_repository.raw.commit_count(self.root_ref)
  109 + raw_repository.commit_count(self.root_ref)
110 110 rescue
111 111 0
112 112 end
... ...