diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /lib/gitlab/cycle_analytics/summary/commit.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'lib/gitlab/cycle_analytics/summary/commit.rb')
-rw-r--r-- | lib/gitlab/cycle_analytics/summary/commit.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/cycle_analytics/summary/commit.rb b/lib/gitlab/cycle_analytics/summary/commit.rb index 76049c6b742..1f426b81800 100644 --- a/lib/gitlab/cycle_analytics/summary/commit.rb +++ b/lib/gitlab/cycle_analytics/summary/commit.rb @@ -9,7 +9,7 @@ module Gitlab end def value - @value ||= count_commits + @value ||= commits_count ? Value::PrettyNumeric.new(commits_count) : Value::None.new end private @@ -18,10 +18,10 @@ module Gitlab # a limit. Since we need a commit count, we _can't_ enforce a limit, so # the easiest way forward is to replicate the relevant portions of the # `log` function here. - def count_commits + def commits_count return unless ref - gitaly_commit_client.commit_count(ref, after: @from, before: @to) + @commits_count ||= gitaly_commit_client.commit_count(ref, after: @from, before: @to) end def gitaly_commit_client |