Commit 7ed935b6765ed1e9de810cfdf8ac9f6eb3fb741d
1 parent
5b219355
Exists in
spb-stable
and in
2 other branches
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>
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
Gemfile
@@ -30,7 +30,7 @@ gem 'omniauth-github' | @@ -30,7 +30,7 @@ gem 'omniauth-github' | ||
30 | 30 | ||
31 | # Extracting information from a git repository | 31 | # Extracting information from a git repository |
32 | # Provide access to Gitlab::Git library | 32 | # Provide access to Gitlab::Git library |
33 | -gem "gitlab_git", '~> 5.8' | 33 | +gem "gitlab_git", '~> 6.0' |
34 | 34 | ||
35 | # Ruby/Rack Git Smart-HTTP Server Handler | 35 | # Ruby/Rack Git Smart-HTTP Server Handler |
36 | gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' | 36 | gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' |
Gemfile.lock
@@ -175,7 +175,7 @@ GEM | @@ -175,7 +175,7 @@ GEM | ||
175 | mime-types (~> 1.19) | 175 | mime-types (~> 1.19) |
176 | gitlab_emoji (0.0.1.1) | 176 | gitlab_emoji (0.0.1.1) |
177 | emoji (~> 1.0.1) | 177 | emoji (~> 1.0.1) |
178 | - gitlab_git (5.9.0) | 178 | + gitlab_git (6.0.0) |
179 | activesupport (~> 4.0) | 179 | activesupport (~> 4.0) |
180 | charlock_holmes (~> 0.6) | 180 | charlock_holmes (~> 0.6) |
181 | gitlab-grit (~> 2.6) | 181 | gitlab-grit (~> 2.6) |
@@ -601,7 +601,7 @@ DEPENDENCIES | @@ -601,7 +601,7 @@ DEPENDENCIES | ||
601 | gitlab-grack (~> 2.0.0.pre) | 601 | gitlab-grack (~> 2.0.0.pre) |
602 | gitlab-linguist (~> 3.0.0) | 602 | gitlab-linguist (~> 3.0.0) |
603 | gitlab_emoji (~> 0.0.1.1) | 603 | gitlab_emoji (~> 0.0.1.1) |
604 | - gitlab_git (~> 5.8) | 604 | + gitlab_git (~> 6.0) |
605 | gitlab_meta (= 6.0) | 605 | gitlab_meta (= 6.0) |
606 | gitlab_omniauth-ldap (= 1.0.4) | 606 | gitlab_omniauth-ldap (= 1.0.4) |
607 | gollum-lib (~> 3.0.0) | 607 | gollum-lib (~> 3.0.0) |
app/models/repository.rb
@@ -106,7 +106,7 @@ class Repository | @@ -106,7 +106,7 @@ class Repository | ||
106 | def commit_count | 106 | def commit_count |
107 | Rails.cache.fetch(cache_key(:commit_count)) do | 107 | Rails.cache.fetch(cache_key(:commit_count)) do |
108 | begin | 108 | begin |
109 | - raw_repository.raw.commit_count(self.root_ref) | 109 | + raw_repository.commit_count(self.root_ref) |
110 | rescue | 110 | rescue |
111 | 0 | 111 | 0 |
112 | end | 112 | end |