From 7ed935b6765ed1e9de810cfdf8ac9f6eb3fb741d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 23:13:31 +0300 Subject: [PATCH] Use gitlab_git to get commit_count in repo. It allows get commits count for git repos with 100k+ commits --- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/models/repository.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 719d65a..6ef2a48 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ gem 'omniauth-github' # Extracting information from a git repository # Provide access to Gitlab::Git library -gem "gitlab_git", '~> 5.8' +gem "gitlab_git", '~> 6.0' # Ruby/Rack Git Smart-HTTP Server Handler gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' diff --git a/Gemfile.lock b/Gemfile.lock index 3fcea78..133fc69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -175,7 +175,7 @@ GEM mime-types (~> 1.19) gitlab_emoji (0.0.1.1) emoji (~> 1.0.1) - gitlab_git (5.9.0) + gitlab_git (6.0.0) activesupport (~> 4.0) charlock_holmes (~> 0.6) gitlab-grit (~> 2.6) @@ -601,7 +601,7 @@ DEPENDENCIES gitlab-grack (~> 2.0.0.pre) gitlab-linguist (~> 3.0.0) gitlab_emoji (~> 0.0.1.1) - gitlab_git (~> 5.8) + gitlab_git (~> 6.0) gitlab_meta (= 6.0) gitlab_omniauth-ldap (= 1.0.4) gollum-lib (~> 3.0.0) diff --git a/app/models/repository.rb b/app/models/repository.rb index f6e44a5..00a1032 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -106,7 +106,7 @@ class Repository def commit_count Rails.cache.fetch(cache_key(:commit_count)) do begin - raw_repository.raw.commit_count(self.root_ref) + raw_repository.commit_count(self.root_ref) rescue 0 end -- libgit2 0.21.2