gitlabhq/app/contexts/test_hook_context.rb
Dmitriy Zaporozhets 5926bbac12 Backend Refactoring
2012-07-31 08:32:49 +03:00

8 lines
314 B
Ruby

class TestHookContext < BaseContext
def execute
hook = project.hooks.find(params[:id])
commits = project.commits(project.default_branch, nil, 3)
data = project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{project.default_branch}", current_user)
hook.execute(data)
end
end