diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 13:37:50 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 13:37:50 +0200 |
commit | 782c8f9aa0a32def807da126e9f07f278772b6a2 (patch) | |
tree | f365c204920467226d5cb7f19ba43a44a838a37d /app/services/ci | |
parent | d2d2df0738f3cd8311963c34d90ebc8ce4081aa6 (diff) | |
download | gitlab-ce-782c8f9aa0a32def807da126e9f07f278772b6a2.tar.gz |
Fix triggers spec
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/create_trigger_request_service.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/services/ci/create_trigger_request_service.rb b/app/services/ci/create_trigger_request_service.rb index f13ed787ed2..3597372528b 100644 --- a/app/services/ci/create_trigger_request_service.rb +++ b/app/services/ci/create_trigger_request_service.rb @@ -1,10 +1,14 @@ module Ci class CreateTriggerRequestService def execute(project, trigger, ref, variables = nil) - commit = project.gl_project.commit(ref) - return unless commit + target = project.gl_project.repository.rev_parse_target(ref) + return unless target - ci_commit = project.gl_project.ensure_ci_commit(commit.sha) + # check if ref is tag + sha = target.oid + tag = target.is_a?(Rugged::Tag) || target.is_a?(Rugged::Tag::Annotation) + + ci_commit = project.gl_project.ensure_ci_commit(sha) trigger_request = trigger.trigger_requests.create!( variables: variables ) |