summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-04 19:40:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-01-04 19:40:43 +0800
commit454576887b93b5b0a30a87c4ab8b18d0e87299fd (patch)
treebf3e838df74e9f7f37f12e5c308c9986fd047092
parent55949545b36cbb53fc2f138269f2e03e1931aa98 (diff)
downloadgitlab-ce-40622-use-left-right-and-max-count.tar.gz
Adopt --max-count from Gitaly40622-use-left-right-and-max-count
-rw-r--r--lib/gitlab/git/repository.rb19
1 files 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