Skip to content

Only generate repository push email once

The repository push email can be very expensive to generate, especially with syntax-highlighted diffs. Instead of generating the email for each recipient, generate one email object and reset the Message-Id and To headers for each recipient. (Cloning would also be expensive in the case of large emails, although probably not as bad as generating from scratch.)

Closes #17270 (closed).

cc @stanhu: I think this is the least elegant way to do it, and would much rather set the to, cc, or bcc to have all of the recipients, but this way the external behaviour should be unchanged. The patch for EE should be almost identical, just with passing diff_refs: diff_refs to Notify.repository_push_email as an additional part of the options hash.

Merge request reports