diff options
author | Robert Speicher <robert@gitlab.com> | 2016-03-08 23:11:40 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-03-08 23:11:40 +0300 |
commit | e8cd04e831a2db36c4029f2c193fc40d2568c79e (patch) | |
tree | 62d0449fb89e79db95abb2aa951ad3850470a6b8 /spec/factories/personal_snippets.rb | |
parent | fe9a445faaaa5a90c9308b01877aadc1984a111b (diff) | |
parent | 590e1b4b21f2a39bf573800392b04859b563f3e5 (diff) |
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
Diffstat (limited to 'spec/factories/personal_snippets.rb')
0 files changed, 0 insertions, 0 deletions