diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-06-17 09:33:43 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-06-17 09:33:43 +0000 |
commit | faee4763f7a166772bb40945f82da4b25a95e7d5 (patch) | |
tree | a80286fb492f666698e26a91d5c44b907d673eb4 | |
parent | f011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff) | |
parent | 5d33af5ee5d13ca35669d7277b6cdd6357e0bca6 (diff) | |
download | gitlab-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-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/repository.rb | 2 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 4 |
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 |