summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-14 13:06:07 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-19 09:24:46 +0200
commit6e25935f73d088eca71619bdfde2b7a9379edcf0 (patch)
tree8e96ba890130aa640f5c891bc03d897cf041d9d9
parent0716e19271ec8234b06164bf701a33c16bd221de (diff)
downloadgitlab-ce-6e25935f73d088eca71619bdfde2b7a9379edcf0.tar.gz
Move count commit to mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/330
-rw-r--r--lib/gitlab/git/repository.rb20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index eb5d6318dcb..51ed4d8e21c 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -676,15 +676,9 @@ module Gitlab
end
# Return total commits count accessible from passed ref
- #
- # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/330
def commit_count(ref)
- gitaly_migrate(:commit_count, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
- if is_enabled
- gitaly_commit_client.commit_count(ref)
- else
- rugged_commit_count(ref)
- end
+ wrapped_gitaly_errors do
+ gitaly_commit_client.commit_count(ref)
end
end
@@ -2393,16 +2387,6 @@ module Gitlab
nil
end
- def rugged_commit_count(ref)
- walker = Rugged::Walker.new(rugged)
- walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
- oid = rugged.rev_parse_oid(ref)
- walker.push(oid)
- walker.count
- rescue Rugged::ReferenceError
- 0
- end
-
def rev_list_param(spec)
spec == :all ? ['--all'] : spec
end