gitlab-org--gitlab-foss/lib/gitlab/gitaly_client/notifications.rb

19 lines
526 B
Ruby
Raw Normal View History

module Gitlab
module GitalyClient
class Notifications
attr_accessor :stub
def initialize(repository_storage, relative_path)
2017-04-06 14:54:15 +00:00
@channel = Util.channel(repository_storage)
@repository = Util.repository(repository_storage, relative_path)
@stub = Gitaly::Notifications::Stub.new(nil, nil, channel_override: @channel)
end
def post_receive
request = Gitaly::PostReceiveRequest.new(repository: @repository)
@stub.post_receive(request)
end
end
end
end