summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-05-03 13:40:59 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-05-03 13:40:59 +0200
commit23a3e3756a4f44aa8bd69310a2e584c1d4f7af1d (patch)
tree25b70430a878aa1de8ca52571de723a862e3f602 /app
parentf4e0c56279007fd6cec3d8e6bd684f0483b0e0ff (diff)
downloadgitlab-ce-23a3e3756a4f44aa8bd69310a2e584c1d4f7af1d.tar.gz
Inform user about questionable hook success
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/hooks_controller.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index 366373b0f0a..9869d90831c 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -27,8 +27,10 @@ class Projects::HooksController < Projects::ApplicationController
if !@project.empty_repo?
status, message = TestHookService.new.execute(hook, current_user)
- if status
- flash[:notice] = "Hook successfully executed, HTTP #{status} #{message}"
+ if status && status >= 200 && status < 400
+ flash[:notice] = "Hook executed successfully"
+ elsif status
+ flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}"
else
flash[:alert] = "Hook execution failed: #{message}"
end