mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-25 20:46:12 +10:00
Conflicts: app/controllers/uploads_controller.rb app/helpers/application_helper.rb app/models/note.rb app/services/test_hook_service.rb db/schema.rb spec/models/note_spec.rb
17 lines
323 B
Ruby
17 lines
323 B
Ruby
class TestHookService
|
|
def execute(hook, current_user)
|
|
data = Gitlab::PushDataBuilder.build_sample(project(hook), current_user)
|
|
hook.execute(data, 'push_hooks')
|
|
end
|
|
|
|
private
|
|
|
|
def project(hook)
|
|
if hook.is_a? GroupHook
|
|
hook.group.first_non_empty_project
|
|
else
|
|
hook.project
|
|
end
|
|
end
|
|
end
|