gitlab-org--gitlab-foss/lib/gitlab/diff
Sean McGivern cdf3ae04f8 Fix 500 error when diff context line has broken encoding
Rugged sometimes chops a context line in between bytes, resulting in the context
line having an invalid encoding: https://github.com/libgit2/rugged/issues/716

When that happens, we will try to detect the encoding for the diff, and
sometimes we'll get it wrong. If that difference in encoding results in a
difference in string lengths between the diff and the underlying blobs, we'd
fail to highlight any inline diffs, and return a 500 status to the user.

As we're using the underlying blobs, the encoding is 'correct' anyway, so if the
string range is invalid, we can just discard the inline diff highlighting. We
still report to Sentry to ensure that we can investigate further in future.
2018-02-22 12:26:23 +00:00
..
file_collection
formatters
diff_refs.rb
file.rb Fix error when viewing diffs without blobs 2018-01-04 14:33:12 +00:00
highlight.rb Fix 500 error when diff context line has broken encoding 2018-02-22 12:26:23 +00:00
image_point.rb
inline_diff.rb
inline_diff_markdown_marker.rb
inline_diff_marker.rb
line.rb
line_mapper.rb
parallel_diff.rb
parser.rb
position.rb
position_tracer.rb