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 Batchload blobs for diff generation 2017-11-21 13:53:26 +01:00
formatters Commenting on image diffs 2017-10-07 04:25:17 +00:00
diff_refs.rb add support for the commit reference filter 2017-12-07 09:01:37 -05:00
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 Commenting on image diffs 2017-10-07 04:25:17 +00:00
inline_diff.rb fix #39233 - 500 in merge request 2017-12-07 20:19:37 +01:00
inline_diff_markdown_marker.rb Extract generic parts of Gitlab::Diff::InlineDiffMarker 2017-05-10 08:26:21 -05:00
inline_diff_marker.rb changed InlineDiffMarker to make it html_safe its output 2017-09-12 13:42:40 -04:00
line.rb Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04:00
line_mapper.rb Whitelist or fix additional Gitlab/PublicSend cop violations 2017-08-14 12:14:11 -04:00
parallel_diff.rb Don't display comment on unchanged line on both sides in parallel diff 2017-06-19 11:50:46 -05:00
parser.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
position.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
position_tracer.rb Fix Diff::Position#diff_file for positions on straight diffs 2017-06-06 14:48:05 -05:00