Skip to content
Snippets Groups Projects
Commit de27375d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Test git builder over annotated tag

parent a0d4235c
No related branches found
No related tags found
1 merge request!8686add "Uplaod" and "Replace" functionality
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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 }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment