Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8ca55c37
Commit
8ca55c37
authored
Aug 18, 2020
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache Repository#has_ambiguous_refs? properly
parent
b66f1d0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
app/models/repository.rb
app/models/repository.rb
+3
-2
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+2
-2
No files found.
app/models/repository.rb
View file @
8ca55c37
...
...
@@ -220,6 +220,7 @@ class Repository
prefix_regex
.
match?
(
ref
)
end
end
cache_method
:has_ambiguous_refs?
def
expand_ref
(
ref
)
if
tag_exists?
(
ref
)
...
...
@@ -311,12 +312,12 @@ class Repository
end
def
expire_tags_cache
expire_method_caches
(
%i(tag_names tag_count)
)
expire_method_caches
(
%i(tag_names tag_count
has_ambiguous_refs?
)
)
@tags
=
nil
end
def
expire_branches_cache
expire_method_caches
(
%i(branch_names merged_branch_names branch_count has_visible_content?)
)
expire_method_caches
(
%i(branch_names merged_branch_names branch_count has_visible_content?
has_ambiguous_refs?
)
)
@local_branches
=
nil
@branch_exists_memo
=
nil
end
...
...
spec/models/repository_spec.rb
View file @
8ca55c37
...
...
@@ -2103,7 +2103,7 @@ RSpec.describe Repository do
describe
'#expire_branches_cache'
do
it
'expires the cache'
do
expect
(
repository
).
to
receive
(
:expire_method_caches
)
.
with
(
%i(branch_names merged_branch_names branch_count has_visible_content?)
)
.
with
(
%i(branch_names merged_branch_names branch_count has_visible_content?
has_ambiguous_refs?
)
)
.
and_call_original
repository
.
expire_branches_cache
...
...
@@ -2113,7 +2113,7 @@ RSpec.describe Repository do
describe
'#expire_tags_cache'
do
it
'expires the cache'
do
expect
(
repository
).
to
receive
(
:expire_method_caches
)
.
with
(
%i(tag_names tag_count)
)
.
with
(
%i(tag_names tag_count
has_ambiguous_refs?
)
)
.
and_call_original
repository
.
expire_tags_cache
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment