summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Bobbitt <ryehle@us.ibm.com>2017-09-11 22:50:12 -0400
committerRobin Bobbitt <ryehle@us.ibm.com>2017-09-21 09:13:00 -0400
commitfbe205f92f144185a12d5c05e5094e831c14913c (patch)
treec61ecd0a81c770fde286db7ed9684c72d8c8b2f8 /lib
parentcfccb2785fb8b98a013170aae4b931e9431739d1 (diff)
downloadgitlab-ce-fbe205f92f144185a12d5c05e5094e831c14913c.tar.gz
Display full pre-receive and post-receive hook output in GitLab UI
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/hook.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb
index cc35d77c6e4..208e4bbaf60 100644
--- a/lib/gitlab/git/hook.rb
+++ b/lib/gitlab/git/hook.rb
@@ -83,13 +83,14 @@ module Gitlab
def call_update_hook(gl_id, oldrev, newrev, ref)
Dir.chdir(repo_path) do
stdout, stderr, status = Open3.capture3({ 'GL_ID' => gl_id }, path, ref, oldrev, newrev)
- [status.success?, stderr.presence || stdout]
+ [status.success?, (stderr.presence || stdout).gsub(/\R/, "<br>").html_safe]
end
end
def retrieve_error_message(stderr, stdout)
- err_message = stderr.gets
- err_message.blank? ? stdout.gets : err_message
+ err_message = stderr.read
+ err_message = err_message.blank? ? stdout.read : err_message
+ err_message.gsub(/\R/, "<br>").html_safe
end
end
end