From 454576887b93b5b0a30a87c4ab8b18d0e87299fd Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 4 Jan 2018 19:40:43 +0800 Subject: Adopt --max-count from Gitaly --- lib/gitlab/git/repository.rb | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 5ff90b7c4ea..b7010af96e8 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1458,17 +1458,6 @@ module Gitlab end end - def gitaly_commit_count(ref, options) - max_count = options[:max_count] - count = gitaly_commit_client.commit_count(ref, options) - - if max_count && count > max_count - max_count - else - count - end - end - def log_using_shell?(options) options[:path].present? || options[:disable_walk] || @@ -1695,12 +1684,14 @@ module Gitlab from = options[:from] to = options[:to] - right_count = gitaly_commit_count("#{from}..#{to}", options) - left_count = gitaly_commit_count("#{to}..#{from}", options) + right_count = gitaly_commit_client + .commit_count("#{from}..#{to}", options) + left_count = gitaly_commit_client + .commit_count("#{to}..#{from}", options) [left_count, right_count] else - gitaly_commit_count(options[:ref], options) + gitaly_commit_client.commit_count(options[:ref], options) end end -- cgit v1.2.1