2017-02-05 13:04:23 -05:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
|
|
|
class Notifications
|
|
|
|
attr_accessor :stub
|
|
|
|
|
2017-04-07 05:19:20 -04:00
|
|
|
# 'repository' is a Gitlab::Git::Repository
|
|
|
|
def initialize(repository)
|
|
|
|
@gitaly_repo = repository.gitaly_repository
|
2017-05-10 08:18:59 -04:00
|
|
|
@stub = GitalyClient.stub(:notifications, repository.storage)
|
2017-02-05 13:04:23 -05:00
|
|
|
end
|
|
|
|
|
2017-03-22 13:23:40 -04:00
|
|
|
def post_receive
|
2017-04-07 05:19:20 -04:00
|
|
|
request = Gitaly::PostReceiveRequest.new(repository: @gitaly_repo)
|
2017-03-22 13:23:40 -04:00
|
|
|
@stub.post_receive(request)
|
2017-02-05 13:04:23 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|