Commit 39ada489 authored by Stan Hu's avatar Stan Hu

Don't attempt to include too large diffs in e-mail-on-push messages

Possible cause of issues in gitlab-org/gitlab-ce#15137
parent d01168a1
Please view this file on the master branch, on stable branches it's out of date.
v 8.7.0 (unreleased)
- Don't attempt to include too large diffs in e-mail-on-push messages (Stan Hu)
- Update GitLab Pages to 0.2.1: support user-defined 404 pages
- Refactor group sync to pull access level logic to its own class. !306
- [Elastic] Stabilize database indexer if database is inconsistent
......
......@@ -48,33 +48,34 @@
- unless @message.disable_diffs?
- diff_files = @message.diffs
%h4 Changes:
- diff_files.each_with_index do |diff_file, i|
%li{id: "diff-#{i}"}
%a{href: @message.target_url + "#diff-#{i}"}
- if diff_file.deleted_file
%strong
= diff_file.old_path
deleted
- elsif diff_file.renamed_file
%strong
= diff_file.old_path
→
%strong
= diff_file.new_path
- if @message.compare_timeout
%h5 The diff was not included because it is too large.
- else
%h4 Changes:
- diff_files.each_with_index do |diff_file, i|
%li{id: "diff-#{i}"}
%a{href: @message.target_url + "#diff-#{i}"}
- if diff_file.deleted_file
%strong
= diff_file.old_path
deleted
- elsif diff_file.renamed_file
%strong
= diff_file.old_path
→
%strong
= diff_file.new_path
- else
%strong
= diff_file.new_path
%hr
- diff_commit = diff_file.deleted_file ? @message.diff_refs.first : @message.diff_refs.last
- blob = @message.project.repository.blob_for_diff(diff_commit, diff_file)
- if blob && blob.respond_to?(:text?) && blob_text_viewable?(blob)
%table.code.white
- diff_file.highlighted_diff_lines.each do |line|
= render "projects/diffs/line", {line: line, diff_file: diff_file, line_code: nil, plain: true}
- else
%strong
= diff_file.new_path
%hr
- diff_commit = diff_file.deleted_file ? @message.diff_refs.first : @message.diff_refs.last
- blob = @message.project.repository.blob_for_diff(diff_commit, diff_file)
- if blob && blob.respond_to?(:text?) && blob_text_viewable?(blob)
%table.code.white
- diff_file.highlighted_diff_lines.each do |line|
= render "projects/diffs/line", {line: line, diff_file: diff_file, line_code: nil, plain: true}
- else
No preview for this file type
%br
No preview for this file type
%br
- if @message.compare_timeout
%h5 Huge diff. To prevent performance issues changes are hidden
......@@ -25,24 +25,26 @@
- else
\- #{diff.new_path}
- unless @message.disable_diffs?
\
\
Changes:
- @message.diffs.each do |diff_file|
- if @message.compare_timeout
\
\=====================================
- if diff_file.deleted_file
#{diff_file.old_path} deleted
- elsif diff_file.renamed_file
#{diff_file.old_path}#{diff_file.new_path}
- else
= diff_file.new_path
\=====================================
!= diff_file.diff.diff
- if @message.compare_timeout
\
\
Huge diff. To prevent performance issues it was hidden
\
The diff was not included because it is too large.
- else
\
\
Changes:
- @message.diffs.each do |diff_file|
\
\=====================================
- if diff_file.deleted_file
#{diff_file.old_path} deleted
- elsif diff_file.renamed_file
#{diff_file.old_path}#{diff_file.new_path}
- else
= diff_file.new_path
\=====================================
!= diff_file.diff.diff
- if @message.target_url
\
\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment