diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-07-04 17:47:30 +0000 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-07-04 17:47:30 +0000 |
| commit | b734167b7aaccdb379c0241344d24fa1f1039712 (patch) | |
| tree | 5a50d2990f47eb349469ba50eaef26913de4f32f /lib | |
| parent | 432929fd4553a1d606fa33889d02d28e79fd8064 (diff) | |
| parent | 926a8ab4765fe9249bfb54926ef8efa3ee78fd16 (diff) | |
| download | gitlab-ce-b734167b7aaccdb379c0241344d24fa1f1039712.tar.gz | |
Merge branch 'more_descriptive_git_shell_messages' into 'master'
Handle custom Git hook result in GitLab UI
## What does this MR do?
This MR fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19190
It allows to show messages from git custom hooks
## Screenshots (if relevant)

See merge request !5073
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/git/hook.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb index 5415f4844d3..420c6883c45 100644 --- a/lib/gitlab/git/hook.rb +++ b/lib/gitlab/git/hook.rb @@ -41,7 +41,7 @@ module Gitlab chdir: repo_path } - Open3.popen3(vars, path, options) do |stdin, _, stderr, wait_thr| + Open3.popen3(vars, path, options) do |stdin, stdout, stderr, wait_thr| exit_status = true stdin.sync = true @@ -60,7 +60,7 @@ module Gitlab unless wait_thr.value == 0 exit_status = false - exit_message = stderr.gets + exit_message = retrieve_error_message(stderr, stdout) end end @@ -76,6 +76,11 @@ module Gitlab [status, nil] end + + def retrieve_error_message(stderr, stdout) + err_message = stderr.gets + err_message.blank? ? stdout.gets : err_message + end end end end |
