diff options
author | Massimeddu Cireddu <massimeddu@gmail.com> | 2019-09-02 13:43:54 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-02 13:43:54 +0300 |
commit | aef0d817927f514ad5a0a42203aff94e30f13740 (patch) | |
tree | 373c3f577ce1f43fb004e0f20f4313dc15bc1518 /lib/gitlab | |
parent | c0e679e098688080b1835526eb0bca910dcb030c (diff) |
Fixing #65389
Wrong format on MS Teams integration push events with multi line commit messages
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/diff/suggestion.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/regex.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/diff/suggestion.rb b/lib/gitlab/diff/suggestion.rb index 4a3ac2106e2..b669e785721 100644 --- a/lib/gitlab/diff/suggestion.rb +++ b/lib/gitlab/diff/suggestion.rb @@ -46,7 +46,7 @@ module Gitlab private def line_break_chars(line) - match = /\r\n|\r|\n/.match(line) + match = Gitlab::Regex.breakline_regex.match(line) match[0] if match end end diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index e6372a42dda..6636ffa448e 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -115,5 +115,9 @@ module Gitlab def jira_transition_id_regex @jira_transition_id_regex ||= /\d+/ end + + def breakline_regex + @breakline_regex ||= /\r\n|\r|\n/ + end end end |