gitlab-org--gitlab-foss/app
Robert Speicher e8cd04e831 Merge branch 'branch-tag-count-methods' into 'master'
Use dedicated methods for counting branches and tags

This started out as "Lets add two methods to count and cache some data" and ended up in a clean-up/fix of some existing code. The two problems were:

1. Different code was used for adding/removing branches/tags via Git and the UI
2. The code used for the UI didn't have any RSpec tests, and I couldn't find any Spinach tests either (though grepping for Spinach stuff is hard)

This MR addresses the following:

1. `Repository#branch_count` and `Repository#tag_count` are used to count and cache the number of branches/tags, these methods are then used on the branches/commits/tags pages.
2. `Repository#add_tag`, `Repository#add_branch`, `Repository#rm_tag` and `Repository#rm_branch` now all the appropriate before/after hook methods instead of calling a random single cache expiration method. This ensures caches are properly flushed when adding/removing tags/branches via the UI.
3. RSpec tests were added for the above methods.

This fixes gitlab-org/gitlab-ce#13459

See merge request !3128
2016-03-08 20:11:40 +00:00
..
assets Merge branch 'issue_13621_2' into 'master' 2016-03-07 17:18:25 +00:00
controllers Remove instance variable @group multiple assignment 2016-03-08 16:48:00 +01:00
finders Updates from last code review. 2016-03-06 23:07:19 -05:00
helpers Merge branch 'cache-raw-2' into 'master' 2016-03-07 22:05:15 +00:00
mailers Fix broken link in CI build notification emails 2016-02-12 14:01:27 +01:00
models Call after_create_branch in Repository#add_branch 2016-03-08 18:19:40 +01:00
services Cache & flush tag/branch counts 2016-03-08 18:19:40 +01:00
uploaders Minor changes on avatar cropping internals 2016-02-18 13:12:39 +01:00
validators Allow webhooks URL to have leading and trailing spaces 2016-02-26 14:34:06 -05:00
views Cache & flush tag/branch counts 2016-03-08 18:19:40 +01:00
workers Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00