Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-14 15:13:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-14 15:13:33 +0300
commit79a7da2537e94c34aba92ad4b9a5dc1da431b2c4 (patch)
tree83b6a53a15a9266ca2e2aca061dd3f33d5282b1f /lib/gitlab/diff
parenta58667ab4b4fc4b0d1e47e95d91c27ccadd0acd3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/custom_diff.rb2
-rw-r--r--lib/gitlab/diff/inline_diff.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/diff/custom_diff.rb b/lib/gitlab/diff/custom_diff.rb
index e1d3cea4306..3928ece9281 100644
--- a/lib/gitlab/diff/custom_diff.rb
+++ b/lib/gitlab/diff/custom_diff.rb
@@ -36,7 +36,7 @@ module Gitlab
end
def strip_diff_frontmatter(diff_content)
- diff_content.scan(/.*\n/)[2..-1]&.join('') if diff_content.present?
+ diff_content.scan(/.*\n/)[2..]&.join('') if diff_content.present?
end
def blobs_with_transformed_diffs
diff --git a/lib/gitlab/diff/inline_diff.rb b/lib/gitlab/diff/inline_diff.rb
index f70618195d0..802da50cfc6 100644
--- a/lib/gitlab/diff/inline_diff.rb
+++ b/lib/gitlab/diff/inline_diff.rb
@@ -6,8 +6,8 @@ module Gitlab
attr_accessor :old_line, :new_line, :offset
def initialize(old_line, new_line, offset: 0)
- @old_line = old_line[offset..-1]
- @new_line = new_line[offset..-1]
+ @old_line = old_line[offset..]
+ @new_line = new_line[offset..]
@offset = offset
end