Commit 435f4ff2 authored by Stan Hu's avatar Stan Hu

In emails-on-push message, indicate message that individual file diff is too large

Diff overflow limits apply to different cases:

1. The entire diff exceeds 100 files OR 5000 lines
2. One single file exceeds 100 KB

Example case 2: Let's say we have a diff of 50 files, most of them under 100
KB, but one of them over that limit. In this case, the idea of
gitlab-org/gitlab-ce!2705 is that GitLab should show the diff of the 49 files
but omit the last one.
parent 2981044f
......@@ -68,14 +68,17 @@
- 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}
- if diff_file.too_large?
The diff for this file was not included because it is too large.
- else
No preview for this file type
%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
......@@ -43,7 +43,10 @@
- else
= diff_file.new_path
\=====================================
!= diff_file.diff.diff
- if diff_file.too_large?
The diff for this file was not included because it is too large.
- else
!= 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