summaryrefslogtreecommitdiff
path: root/lib/gitlab/gitaly_client/notifications.rb
blob: f0d93ded91b307f68b64299503dd49a1fb289c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Gitlab
  module GitalyClient
    class Notifications
      attr_accessor :stub

      def initialize(repository_storage, relative_path)
        @channel, @repository = Util.process_path(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