2017-02-05 18:04:23 +00:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
2017-07-18 07:59:36 +00:00
|
|
|
class NotificationService
|
2017-04-07 09:19:20 +00:00
|
|
|
# 'repository' is a Gitlab::Git::Repository
|
|
|
|
def initialize(repository)
|
|
|
|
@gitaly_repo = repository.gitaly_repository
|
2017-06-16 16:42:41 +00:00
|
|
|
@storage = repository.storage
|
2017-02-05 18:04:23 +00:00
|
|
|
end
|
|
|
|
|
2017-03-22 17:23:40 +00:00
|
|
|
def post_receive
|
2017-06-16 16:42:41 +00:00
|
|
|
GitalyClient.call(
|
|
|
|
@storage,
|
2017-07-18 07:59:36 +00:00
|
|
|
:notification_service,
|
2017-06-16 16:42:41 +00:00
|
|
|
:post_receive,
|
|
|
|
Gitaly::PostReceiveRequest.new(repository: @gitaly_repo)
|
|
|
|
)
|
2017-02-05 18:04:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|