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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
d331377a
Commit
d331377a
authored
Jul 23, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show optional tag message in quick action explanation
parent
591fc8f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
app/services/quick_actions/interpret_service.rb
app/services/quick_actions/interpret_service.rb
+3
-2
spec/services/quick_actions/interpret_service_spec.rb
spec/services/quick_actions/interpret_service_spec.rb
+28
-4
No files found.
app/services/quick_actions/interpret_service.rb
View file @
d331377a
...
...
@@ -583,8 +583,9 @@ module QuickActions
end
desc
'Tag this commit.'
explanation
do
|
(
tag_name
),
_
|
"Tags this commit to
#{
tag_name
}
."
explanation
do
|
(
tag_name
,
message
)
|
with_message
=
%{ with "#{message}"}
if
message
.
present?
"Tags this commit to
#{
tag_name
}#{
with_message
}
."
end
params
'v1.2.3 <message>'
parse_params
do
|
tag_name_and_message
|
...
...
spec/services/quick_actions/interpret_service_spec.rb
View file @
d331377a
...
...
@@ -1356,12 +1356,36 @@ describe QuickActions::InterpretService do
end
describe
'tag a commit'
do
let
(
:content
)
{
'/tag 1.2.3 some message'
}
describe
'with a tag name'
do
context
'without a message'
do
let
(
:content
)
{
'/tag v1.2.3'
}
it
'includes the tag name
'
do
_
,
explanations
=
service
.
explain
(
content
,
commit
)
it
'includes the tag name only
'
do
_
,
explanations
=
service
.
explain
(
content
,
commit
)
expect
(
explanations
).
to
eq
([
"Tags this commit to 1.2.3."
])
expect
(
explanations
).
to
eq
([
"Tags this commit to v1.2.3."
])
end
end
context
'with an empty message'
do
let
(
:content
)
{
'/tag v1.2.3 '
}
it
'includes the tag name only'
do
_
,
explanations
=
service
.
explain
(
content
,
commit
)
expect
(
explanations
).
to
eq
([
"Tags this commit to v1.2.3."
])
end
end
end
describe
'with a tag name and message'
do
let
(
:content
)
{
'/tag v1.2.3 Stable release'
}
it
'includes the tag name and message'
do
_
,
explanations
=
service
.
explain
(
content
,
commit
)
expect
(
explanations
).
to
eq
([
"Tags this commit to v1.2.3 with
\"
Stable release
\"
."
])
end
end
end
end
...
...
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