Commit 4e49f21b authored by Douwe Maan's avatar Douwe Maan

Set push data object kind in PushDataBuilder.

parent 606d24ff
...@@ -40,9 +40,7 @@ class CreateTagService < BaseService ...@@ -40,9 +40,7 @@ class CreateTagService < BaseService
end end
def create_push_data(project, user, tag) def create_push_data(project, user, tag)
data = Gitlab::PushDataBuilder. Gitlab::PushDataBuilder.
build(project, user, Gitlab::Git::BLANK_SHA, tag.target, "#{Gitlab::Git::TAG_REF_PREFIX}#{tag.name}", []) build(project, user, Gitlab::Git::BLANK_SHA, tag.target, "#{Gitlab::Git::TAG_REF_PREFIX}#{tag.name}", [])
data[:object_kind] = "tag_push"
data
end end
end end
...@@ -16,8 +16,6 @@ class GitTagPushService ...@@ -16,8 +16,6 @@ class GitTagPushService
private private
def create_push_data(oldrev, newrev, ref) def create_push_data(oldrev, newrev, ref)
data = Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, []) Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
data[:object_kind] = "tag_push"
data
end end
end end
...@@ -28,9 +28,10 @@ module Gitlab ...@@ -28,9 +28,10 @@ module Gitlab
# Get latest 20 commits ASC # Get latest 20 commits ASC
commits_limited = commits.last(20) commits_limited = commits.last(20)
type = Gitlab::Git.tag_ref?(ref) ? "tag_push" : "push"
# Hash to be passed as post_receive_data # Hash to be passed as post_receive_data
data = { data = {
object_kind: "push", object_kind: type,
before: oldrev, before: oldrev,
after: newrev, after: newrev,
ref: ref, ref: ref,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment