diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-16 13:11:55 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-06 14:54:54 +0300 |
commit | 2dd66ad34a5b4a2d50da31ae440470ef02d28aaf (patch) | |
tree | a84bf014487bb05668f61481dc1d69129d9d73ab /lib | |
parent | 411cc6e4c59e6f61181d456cec127c344f277a7f (diff) |
Merge branch 'fix_diff_parsing' into 'master'
Fix diff parser so it tolerates to diff special markers in the content
Closes #34431
See merge request gitlab-org/gitlab-ce!14848
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/parser.rb | 4 |
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") |