summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2017-10-12 18:59:02 +0300
committerValery Sizov <valery@gitlab.com>2017-10-15 17:00:36 +0300
commitd09895a0de015073301296597085d8c376870513 (patch)
tree31d70b0c589c60e5455b55502f149207ed049a40 /lib
parent1e4b75ba40570a3e96e1999e375a120c4ba8b346 (diff)
downloadgitlab-ce-d09895a0de015073301296597085d8c376870513.tar.gz
Fix diff parser so it tolerates to diff special markers in the content
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/parser.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index 742f989c50b..7dc9cc7c281 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -17,7 +17,9 @@ module Gitlab
# without having to instantiate all the others that come after it.
Enumerator.new do |yielder|
@lines.each do |line|
- next if filename?(line)
+ # We're expecting a filename parameter only in a meta-part of the diff content
+ # when type is defined then we're already in a content-part
+ next if filename?(line) && type.nil?
full_line = line.delete("\n")