Set push data object kind in PushDataBuilder.

This commit is contained in:
Douwe Maan 2015-03-13 14:51:48 +01:00
parent 606d24ff2d
commit 4e49f21b14
3 changed files with 4 additions and 7 deletions

View File

@ -40,9 +40,7 @@ class CreateTagService < BaseService
end
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}", [])
data[:object_kind] = "tag_push"
data
end
end

View File

@ -16,8 +16,6 @@ class GitTagPushService
private
def create_push_data(oldrev, newrev, ref)
data = Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
data[:object_kind] = "tag_push"
data
Gitlab::PushDataBuilder.build(project, user, oldrev, newrev, ref, [])
end
end

View File

@ -28,9 +28,10 @@ module Gitlab
# Get latest 20 commits ASC
commits_limited = commits.last(20)
type = Gitlab::Git.tag_ref?(ref) ? "tag_push" : "push"
# Hash to be passed as post_receive_data
data = {
object_kind: "push",
object_kind: type,
before: oldrev,
after: newrev,
ref: ref,