diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-19 09:55:38 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-19 09:55:38 +0000 |
commit | 9e82c32b31424f8899c53634239ceb0873cb5674 (patch) | |
tree | fbc8ce284407d0e830f90722095d212e8221e42b | |
parent | 7a42d86581ec4515466f0e97c1e6b3d0feb53259 (diff) | |
parent | 6e25935f73d088eca71619bdfde2b7a9379edcf0 (diff) | |
download | gitlab-ce-9e82c32b31424f8899c53634239ceb0873cb5674.tar.gz |
Merge branch 'zj-commit-count' into 'master'
Move count commit to mandatory
Closes gitaly#330
See merge request gitlab-org/gitlab-ce!19984
-rw-r--r-- | lib/gitlab/git/repository.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index b028753bb2e..a3aab1e0e85 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 @@ -2383,16 +2377,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 |