Commit Graph

63 Commits

Author SHA1 Message Date
GitLab Bot ecdd26856c Add latest changes from gitlab-org/gitlab@master 2024-01-02 12:07:21 +00:00
GitLab Bot 7e29b8f3fc Add latest changes from gitlab-org/gitlab@master 2023-09-21 09:10:54 +00:00
GitLab Bot c478950af9 Add latest changes from gitlab-org/gitlab@master 2023-03-27 18:15:54 +00:00
GitLab Bot 67fa8362ae Add latest changes from gitlab-org/gitlab@master 2022-05-06 15:09:03 +00:00
GitLab Bot ca5de52835 Add latest changes from gitlab-org/gitlab@master 2021-12-10 18:14:42 +00:00
GitLab Bot c592490e7f Add latest changes from gitlab-org/gitlab@master 2021-11-25 21:09:52 +00:00
GitLab Bot 76cbe9e688 Add latest changes from gitlab-org/gitlab@master 2021-11-12 15:12:37 +00:00
GitLab Bot 024e8b496d Add latest changes from gitlab-org/gitlab@master 2021-11-01 18:12:42 +00:00
GitLab Bot 46aea02972 Add latest changes from gitlab-org/gitlab@master 2021-06-16 00:10:15 +00:00
GitLab Bot 25db9c1230 Add latest changes from gitlab-org/gitlab@master 2021-05-06 12:10:38 +00:00
GitLab Bot 8bcfcd53f3 Add latest changes from gitlab-org/gitlab@master 2021-04-20 15:09:24 +00:00
GitLab Bot 4d16568658 Add latest changes from gitlab-org/gitlab@master 2021-03-18 06:11:52 +00:00
GitLab Bot 099333e261 Add latest changes from gitlab-org/gitlab@master 2021-03-18 00:08:58 +00:00
GitLab Bot 9c0f4306f6 Add latest changes from gitlab-org/gitlab@master 2021-03-11 15:09:10 +00:00
GitLab Bot 5d756f9966 Add latest changes from gitlab-org/gitlab@master 2021-03-10 03:09:10 +00:00
GitLab Bot 9ecdb93f4e Add latest changes from gitlab-org/gitlab@master 2021-02-01 12:09:03 +00:00
GitLab Bot a1aeaba23e Add latest changes from gitlab-org/gitlab@master 2020-09-03 09:08:20 +00:00
GitLab Bot d10a462fed Add latest changes from gitlab-org/gitlab@master 2019-12-16 12:07:43 +00:00
GitLab Bot 8cc5f27909 Add latest changes from gitlab-org/gitlab@master 2019-12-13 12:07:41 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
gfyoung 7e6f6e1603 Enable even more frozen string in lib/gitlab
Enables frozens string for the following:

* lib/gitlab/conflict/**/*.rb
* lib/gitlab/cross_project_access/**/*.rb
* lib/gitlab/cycle_analytics/**/*.rb
* lib/gitlab/data_builder/**/*.rb
* lib/gitlab/database/**/*.rb
* lib/gitlab/dependency_linker/**/*.rb
* lib/gitlab/diff/**/*.rb
* lib/gitlab/downtime_check/**/*.rb
* lib/gitlab/email/**/*.rb
* lib/gitlab/etag_caching/**/*.rb

Partially addresses gitlab-org/gitlab-ce#47424.
2018-11-06 22:47:32 -08:00
Mark Chao 39ae9a59a5 Make Highlight accept language param
This replaces the repository param.
This allows more flexiblity as sometimes we have highlight content
not related to repository. Sometimes we know ahead of time the language
of the content. Lastly language determination seems better fit as a
logic in the Blob class.
`repository` param is only used to determine the language, which seems
to be the responsiblity of Blob.
2018-10-30 15:44:55 +08:00
Francisco Javier López c40400ceae [master] Stored XSS in Gitlab Merge Request from imported repository 2018-10-01 16:44:30 +00:00
Chantal Rollison 81a403f05f Escaped html characters 2018-08-21 07:37:33 -07:00
Bob Van Landuyt 5f7f5eda92 Method to track recoverable exceptions in sentry
This adds a method to track errors that can be recovered from in
sentry.

It is useful when debugging performance issues, or exceptions that are
hard to reproduce.
2018-04-17 11:39:23 +02:00
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
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Douwe Maan e6e29f9220 Use Diff::File blob methods from diff highlighter 2017-06-08 09:39:54 -05:00
Douwe Maan db40c668de Rename Diff::File {old,new}_ref to {old,new}_sha 2017-05-23 15:37:04 -05:00
Douwe Maan ccbebbdfeb Enable Performance/RedundantMatch 2017-02-23 09:31:57 -06:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
Douwe Maan ac26b23712 Remove duplication, unused methods, and some other style things 2016-07-06 19:29:41 -04:00
Douwe Maan a27462a5c6 Extract parts of LegacyDiffNote into DiffOnNote concern and move part of responsibility to other classes 2016-07-06 18:50:59 -04:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Douwe Maan 677b4db9e6 Mark inline difference between old and new paths when a file is renamed 2016-01-29 19:37:17 +01:00
Robert Speicher 2fed8bf390 Merge branch 'fix-diff-comments' into 'master'
More highlighted diff fixes

See merge request !2545
2016-01-22 07:37:47 +00:00
Douwe Maan 16d17b78ca Restore diff comments 2016-01-22 02:10:58 +01:00
Douwe Maan 82d0fa8e45 Fix 2016-01-22 01:53:01 +01:00
Douwe Maan 150b4f66e6 Make sure non-highlighted diffs are still escaped 2016-01-22 01:47:17 +01:00
Douwe Maan 0e992a3b4e Properly highlight lines around '\ No newline at end of file' 2016-01-20 19:20:13 +01:00
Douwe Maan 577f2fb47a Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
Douwe Maan 13f10efcf1 Move inline diff marker logic to its own class 2016-01-15 14:39:43 +01:00
Douwe Maan 7d31f37219 Move inline diff logic to its own class 2016-01-15 14:25:29 +01:00
Douwe Maan 71b4341a37 Method was moved 2016-01-15 14:11:36 +01:00
Rubén Dávila 6b9c730e91 More refactoring from last code review. #3945
* Use commit objects instead of IDs when generating diffs
* Use proper references when generating MR's source and target
* Update broken specs
2016-01-14 16:47:55 -05:00
Douwe Maan 8dfad143d4 Add inline diff markers in highlighted diffs. 2016-01-14 22:28:07 +01:00
Douwe Maan 83e4fc188b Refactor highlighting lines 2016-01-14 16:13:35 +01:00
Douwe Maan 3a1d053599 Remove duplication around highlighting. 2016-01-14 15:11:50 +01:00
Rubén Dávila c179b48c97 Use #sub instead of #gsub!. #3945
* This is because is not a good idea to modify the original lines
* Also I run into this issue https://gitlab.com/gitlab-org/gitlab_git/issues/14
  which is returning Diff Lines with the same @new_pos value.
2016-01-13 21:04:53 -05:00
Rubén Dávila 0f0af19139 Little refactor for usage of html_safe. #3945 2016-01-13 11:39:15 -05:00