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