summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-17 09:22:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-17 09:22:42 +0000
commit1db54e228d98d20536133bf52a8af0ce67616dc3 (patch)
tree31bfae0406bc57a74e6a10dffbe4abb90d6a7b6d /app/controllers
parentf165bbd0d7196f7f74a7e5ceb66f2726a9781ba7 (diff)
downloadredmine-1db54e228d98d20536133bf52a8af0ce67616dc3.tar.gz
redmine-1db54e228d98d20536133bf52a8af0ce67616dc3.zip
Don't respond with the error template when annotate is not available.
git-svn-id: http://svn.redmine.org/redmine/trunk@15694 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/repositories_controller.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 9bee5b837..07f1db0b4 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -211,14 +211,17 @@ class RepositoriesController < ApplicationController
@annotate = @repository.scm.annotate(@path, @rev)
if @annotate.nil? || @annotate.empty?
- (render_error l(:error_scm_annotate); return)
- end
- 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
- (render_error l(:error_scm_annotate_big_text_file); return)
+ @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
end
@changeset = @repository.find_changeset_by_name(@rev)
end