BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4ec035b4
Commit
4ec035b4
authored
Mar 08, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call the right hooks in Repository#add_tag
This ensures Repository#add_tag calls Repository#before_push_tag instead of just 1 random cache expiration method.
parent
6857b92f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
repository.rb
app/models/repository.rb
+2
-1
repository_spec.rb
spec/models/repository_spec.rb
+11
-0
No files found.
app/models/repository.rb
View file @
4ec035b4
...
...
@@ -138,7 +138,7 @@ class Repository
end
def
add_tag
(
tag_name
,
ref
,
message
=
nil
)
expire_tags_cache
before_push_tag
gitlab_shell
.
add_tag
(
path_with_namespace
,
tag_name
,
ref
,
message
)
end
...
...
@@ -334,6 +334,7 @@ class Repository
# Runs code before pushing (= creating or removing) a tag.
def
before_push_tag
expire_cache
expire_tags_cache
expire_tag_count_cache
end
...
...
spec/models/repository_spec.rb
View file @
4ec035b4
...
...
@@ -649,6 +649,17 @@ describe Repository, models: true do
end
end
describe
'#add_tag'
do
it
'adds a tag'
do
expect
(
repository
).
to
receive
(
:before_push_tag
)
expect_any_instance_of
(
Gitlab
::
Shell
).
to
receive
(
:add_tag
).
with
(
repository
.
path_with_namespace
,
'8.5'
,
'master'
,
'foo'
)
repository
.
add_tag
(
'8.5'
,
'master'
,
'foo'
)
end
end
describe
'#rm_branch'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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