gitlab-org--gitlab-foss/spec/lib/gitlab/diff
Sean McGivern 528b5eeb76 Fix error when viewing diffs without blobs
Old merge requests can have diffs without corresponding blobs. (This also may be
possible for commit diffs in corrupt repositories.)

We can't use the `&.` operator on the blobs, because the blob objects are never
nil, but `BatchLoader` instances that delegate to `Blob`. We can't use
`Object#try`, because `Blob` doesn't inherit from `Object`.

`BatchLoader` provides a `__sync` method that returns the delegated object, but
using `itself` also works because it's forwarded, and will work for
non-`BatchLoader` instances too. So the simplest solution is to just use that
with the `&.` operator.
2018-01-04 14:33:12 +00:00
..
file_collection
formatters
diff_refs_spec.rb
file_spec.rb Fix error when viewing diffs without blobs 2018-01-04 14:33:12 +00:00
highlight_spec.rb
inline_diff_markdown_marker_spec.rb
inline_diff_marker_spec.rb
inline_diff_spec.rb fix #39233 - 500 in merge request 2017-12-07 20:19:37 +01:00
line_mapper_spec.rb
parallel_diff_spec.rb
parser_spec.rb
position_spec.rb
position_tracer_spec.rb Ensure MRs always use branch refs for comparison 2017-11-28 17:01:38 +00:00