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
de27375d
Commit
de27375d
authored
Jan 15, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test git builder over annotated tag
parent
a0d4235c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
lib/gitlab/push_data_builder.rb
lib/gitlab/push_data_builder.rb
+5
-2
spec/lib/gitlab/push_data_builder_spec.rb
spec/lib/gitlab/push_data_builder_spec.rb
+3
-2
No files found.
lib/gitlab/push_data_builder.rb
View file @
de27375d
...
...
@@ -66,8 +66,11 @@ module Gitlab
if
newrev
!=
Gitlab
::
Git
::
BLANK_SHA
&&
ref
.
start_with?
(
'refs/tags/'
)
tag_name
=
Gitlab
::
Git
.
extract_ref_name
(
ref
)
tag
=
repository
.
find_tag
(
tag_name
)
commit
=
repository
.
commit
(
tag
.
target
)
commit
.
try
(
:sha
)
if
tag
commit
=
repository
.
commit
(
tag
.
target
)
commit
.
try
(
:sha
)
end
else
newrev
end
...
...
spec/lib/gitlab/push_data_builder_spec.rb
View file @
de27375d
...
...
@@ -21,13 +21,14 @@ describe 'Gitlab::PushDataBuilder' do
Gitlab
::
PushDataBuilder
.
build
(
project
,
user
,
Gitlab
::
Git
::
BLANK_SHA
,
'
5937ac0a7beb003549fc5fd26fc247adbce4a52e
'
,
'
8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b
'
,
'refs/tags/v1.1.0'
)
end
it
{
data
.
should
be_a
(
Hash
)
}
it
{
data
[
:before
].
should
==
Gitlab
::
Git
::
BLANK_SHA
}
it
{
data
[
:after
].
should
==
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
}
it
{
data
[
:checkout_sha
].
should
==
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
}
it
{
data
[
:after
].
should
==
'8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b'
}
it
{
data
[
:ref
].
should
==
'refs/tags/v1.1.0'
}
it
{
data
[
:commits
].
should
be_empty
}
it
{
data
[
:total_commits_count
].
should
be_zero
}
...
...
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