Reduce max commit diff size. Added Commit::DIFF_SAFE_SIZE

This commit is contained in:
Dmitriy Zaporozhets 2012-10-25 12:16:14 +03:00
parent 1ea0dd0ffc
commit 6d0dcb6614
4 changed files with 11 additions and 5 deletions

View file

@ -1,11 +1,11 @@
- if @suppress_diff
.alert-message.block-message
%p
%strong Warning! Large commit with more then 200 files changed.
%strong Warning! Large commit with more then #{Commit::DIFF_SAFE_SIZE} files changed.
%p To prevent performance issue we rejected diff information.
%p
But if you still want to see diff
= link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "dark"
= link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "underlined_link"
%p.cgray
Showing #{pluralize(diffs.count, "changed file")}
@ -35,10 +35,10 @@
- if file.text?
= render "commits/text_file", diff: diff, index: i
- elsif file.image?
- if diff.renamed_file || diff.new_file || diff.deleted_file
- if diff.renamed_file || diff.new_file || diff.deleted_file
.diff_file_content_image
%img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
- else
- old_file = (@commit.prev_commit.tree / diff.old_path)
.diff_file_content_image.img_compared
%img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}