Only first line of pre-receive and post-receive hooks error is captured

Summary

We capture only the first line of pre-receive and post-receive hooks output. The error messages returned by custom hooks may span multiple lines and we lose these other lines. For update hook we capture the whole output.

Steps to reproduce

  1. Create a merge request
  2. Create a custom pre-receive hook that outputs multiple lines and returns non-zero status
  3. Try to merge the merge request
  4. In Rails console inspect merge_request.merge_error
Assignee Loading
Time tracking Loading