summaryrefslogtreecommitdiff
path: root/app/controllers/projects/hooks_controller.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-07-24 14:36:31 +0100
committerPhil Hughes <me@iamphill.com>2017-07-24 14:36:31 +0100
commit4d2be5bbec25d60a8d478bda5bc83159f2c845b1 (patch)
treec3c28a833ccd2a6628d928acee44e62ccfcc6fd8 /app/controllers/projects/hooks_controller.rb
parent1a2d180e3dfd8bdad94766a2e8b1195288c2b146 (diff)
parentd4c4dec80dc3abd39116440a3c291c19b27258e1 (diff)
downloadgitlab-ce-4d2be5bbec25d60a8d478bda5bc83159f2c845b1.tar.gz
Merge branch 'master' into sidebar-fly-out-sub-nav
Diffstat (limited to 'app/controllers/projects/hooks_controller.rb')
-rw-r--r--app/controllers/projects/hooks_controller.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index 18895c3f0f3..85d35900c71 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -9,6 +9,10 @@ class Projects::HooksController < Projects::ApplicationController
layout "project_settings"
+ def index
+ redirect_to project_settings_integrations_path(@project)
+ end
+
def create
@hook = @project.hooks.new(hook_params)
@hook.save
@@ -33,13 +37,9 @@ class Projects::HooksController < Projects::ApplicationController
end
def test
- if !@project.empty_repo?
- status, message = TestHookService.new.execute(hook, current_user)
+ result = TestHooks::ProjectService.new(hook, current_user, params[:trigger]).execute
- set_hook_execution_notice(status, message)
- else
- flash[:alert] = 'Hook execution failed. Ensure the project has commits.'
- end
+ set_hook_execution_notice(result)
redirect_back_or_default(default: { action: 'index' })
end