summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-06-17 09:33:43 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-17 09:33:43 +0000
commitfaee4763f7a166772bb40945f82da4b25a95e7d5 (patch)
treea80286fb492f666698e26a91d5c44b907d673eb4
parentf011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff)
parent5d33af5ee5d13ca35669d7277b6cdd6357e0bca6 (diff)
downloadgitlab-ce-faee4763f7a166772bb40945f82da4b25a95e7d5.tar.gz
Merge branch '18709-use-specific-git-cached-counters' into 'master'
Use Git cached counters on project show page See merge request !4711
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/views/projects/show.html.haml4
3 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0596ff37856..f3ac35be81f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -115,6 +115,7 @@ v 8.9.0 (unreleased)
- Various associations are now eager loaded when parsing issue references to reduce the number of queries executed
- Set inverse_of for Project/Service association to reduce the number of queries
- Update tanuki logo highlight/loading colors
+ - Use Git cached counters for branches and tags on project page
v 8.8.5
- Import GitHub repositories respecting the API rate limit !4166
diff --git a/app/models/repository.rb b/app/models/repository.rb
index e5b277cb198..65d1bad511d 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -243,7 +243,7 @@ class Repository
end
def cache_keys
- %i(size branch_names tag_names commit_count
+ %i(size branch_names tag_names branch_count tag_count commit_count
readme version contribution_guide changelog
license_blob license_key gitignore)
end
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 4afa902b4eb..e9ca46a74bf 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -23,10 +23,10 @@
#{'Commit'.pluralize(@project.commit_count)} (#{number_with_delimiter(@project.commit_count)})
%li
= link_to namespace_project_branches_path(@project.namespace, @project) do
- #{'Branch'.pluralize(@repository.branch_names.count)} (#{number_with_delimiter(@repository.branch_names.count)})
+ #{'Branch'.pluralize(@repository.branch_count)} (#{number_with_delimiter(@repository.branch_count)})
%li
= link_to namespace_project_tags_path(@project.namespace, @project) do
- #{'Tag'.pluralize(@repository.tag_names.count)} (#{number_with_delimiter(@repository.tag_names.count)})
+ #{'Tag'.pluralize(@repository.tag_count)} (#{number_with_delimiter(@repository.tag_count)})
- if default_project_view != 'readme' && @repository.readme
%li