Fix huge MR exceptions. Fixed link to diff for it

This commit is contained in:
Dmitriy Zaporozhets 2013-05-22 14:06:08 +03:00
parent 432df031cf
commit 44275e5066
2 changed files with 4 additions and 4 deletions

View file

@ -214,9 +214,9 @@ class MergeRequest < ActiveRecord::Base
end end
def dump_diffs(diffs) def dump_diffs(diffs)
if broken_diffs? if diffs == broken_diffs
broken_diffs broken_diffs
else elsif diffs.respond_to?(:map)
diffs.map(&:to_hash) diffs.map(&:to_hash)
end end
end end
@ -224,7 +224,7 @@ class MergeRequest < ActiveRecord::Base
def load_diffs(raw) def load_diffs(raw)
if raw == broken_diffs if raw == broken_diffs
broken_diffs broken_diffs
else elsif raw.respond_to?(:map)
raw.map { |hash| Gitlab::Git::Diff.new(hash) } raw.map { |hash| Gitlab::Git::Diff.new(hash) }
end end
end end

View file

@ -4,7 +4,7 @@
%h4.nothing_here_message %h4.nothing_here_message
Can't load diff. Can't load diff.
You can You can
= link_to "download it", project_merge_request_path(@project, @merge_request), format: :diff, class: "vlink" = link_to "download it", project_merge_request_path(@project, @merge_request, format: :diff), class: "vlink"
instead. instead.
- else - else
%h4.nothing_here_message Nothing to merge %h4.nothing_here_message Nothing to merge