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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
push_data_builder.rb
lib/gitlab/push_data_builder.rb
+5
-2
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