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:
authorDouwe Maan <douwe@selenight.nl>2016-07-12 19:25:39 +0300
committerDouwe Maan <douwe@selenight.nl>2016-07-12 19:25:39 +0300
commite981d6cd0d6b8ae7d2911a57a65751deaa9ec555 (patch)
tree58056590629a4fdfe8adf6e999a092cc85a85fef /lib/gitlab/diff
parentf5cc3f63a8a6a44e755aa81ac6cba8e544b848e6 (diff)
Extended regexes ignore whitespace, so use \s
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/inline_diff.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/diff/inline_diff.rb b/lib/gitlab/diff/inline_diff.rb
index 72d9abeefcc..4a3eb92b9fc 100644
--- a/lib/gitlab/diff/inline_diff.rb
+++ b/lib/gitlab/diff/inline_diff.rb
@@ -4,7 +4,7 @@ module Gitlab
# Regex to find a run of deleted lines followed by the same number of added lines
REGEX = %r{
# Runs start at the beginning of the string (the first line) or after a space (for an unchanged line)
- (?:\A| )
+ (?:\A|\s)
# This matches a number of `-`s followed by the same number of `+`s through recursion
(?<del_ins>
@@ -14,7 +14,7 @@ module Gitlab
)
# Runs end at the end of the string (the last line) or before a space (for an unchanged line)
- (?= |\z)
+ (?=\s|\z)
}x.freeze
attr_accessor :old_line, :new_line, :offset