summaryrefslogtreecommitdiff
path: root/app/controllers/projects/hooks_controller.rb
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-06-14 00:31:45 +0300
committerFatih Acet <acetfatih@gmail.com>2016-06-14 00:31:45 +0300
commit6dbca80c46093443e69f3faace6f1967570b15fa (patch)
treed3e351e4ed25c347978f33176c729c0495b7de74 /app/controllers/projects/hooks_controller.rb
parent8c058e8563c287817b81a9a122ceeb5a69f6b221 (diff)
parent4a8ae77ebac46545fa4811ea60bf53d1e81f10fc (diff)
downloadgitlab-ce-remove-comment-toggle.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into remove-comment-toggleremove-comment-toggle
Diffstat (limited to 'app/controllers/projects/hooks_controller.rb')
-rw-r--r--app/controllers/projects/hooks_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index dfa9bd259e8..a60027ff477 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.'
+ if status && status >= 200 && status < 400
+ flash[:notice] = "Hook executed successfully: HTTP #{status}"
+ elsif status
+ flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}"
else
flash[:alert] = "Hook execution failed: #{message}"
end
@@ -61,7 +63,8 @@ class Projects::HooksController < Projects::ApplicationController
:push_events,
:tag_push_events,
:token,
- :url
+ :url,
+ :wiki_page_events
)
end
end