Skip to content
Snippets Groups Projects

Parse conflict lines with CRLF endings correctly

Merged Patrick Bajao requested to merge 365343-parse-conflicts-crlf into master
All threads resolved!
2 files
+ 53
28
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 6d34ed5f
    When lines have CRLF endings, GitLab is not able to parse them
    correctly as we match the conflict markers after we delete the
    newline character. That only deletes the LF and keep the CR.
    
    To fix it, we also delete the CR before we match the conflict
    markers.
    
    Changelog: fixed
@@ -27,7 +27,7 @@ def parse(text, our_path:, their_path:, parent_file: nil)
conflict_end = ">>>>>>> #{their_path}"
text.each_line.map do |line|
full_line = line.delete("\n")
full_line = line.chomp
if full_line == conflict_start
validate_delimiter!(type.nil?)
Loading