Feature #35432 » 0001-Code-cleanup-of-RepositoriesController-annotate.patch
| app/controllers/repositories_controller.rb | ||
|---|---|---|
|
(show_error_not_found; return) unless @entry
|
||
|
@annotate = @repository.scm.annotate(@path, @rev)
|
||
|
if @annotate.nil? || @annotate.empty?
|
||
|
if @annotate.blank?
|
||
|
@annotate = nil
|
||
|
@error_message = l(:error_scm_annotate)
|
||
|
else
|
||
|
ann_buf_size = 0
|
||
|
@annotate.lines.each do |buf|
|
||
|
ann_buf_size += buf.size
|
||
|
end
|
||
|
if ann_buf_size > Setting.file_max_size_displayed.to_i.kilobyte
|
||
|
@annotate = nil
|
||
|
@error_message = l(:error_scm_annotate_big_text_file)
|
||
|
end
|
||
|
elsif @annotate.lines.sum(&:size) > Setting.file_max_size_displayed.to_i.kilobyte
|
||
|
@annotate = nil
|
||
|
@error_message = l(:error_scm_annotate_big_text_file)
|
||
|
end
|
||
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||
|
end
|
||