Resolve conflicts: interactive mode does not work when the file has CR LF line terminators

Summary

When trying to resolve conflicts for a merge request that has a conflict on a file with CRLF line delimiters, the interactive conflict resolution (as described in https://docs.gitlab.com/ee/user/project/merge_requests/resolve_conflicts.html) is not shown.

Steps to reproduce

  1. Create conflictual modification in two different branches for a file that has CRLF as terminator
  2. Create a MR
  3. Press Resolve conflicts button

Example Project

https://gitlab.com/mircea.negreanu/test-001

What is the current bug behavior?

The interactive conflict resolution interface (as described in https://gitlab.com/mircea.negreanu/test-001) is not shown. Instead the file is shown with conflict markers and with the Interactive mode button selected.

What is the expected correct behavior?

  1. The interactive conflict resolution interface should be shown
  2. The number of conflicts shown (in the text Showing x conflicts between ...) should be higher than 0

Relevant logs and/or screenshots

image

Note the fact that the conflict was correctly detected.

image

Note:

  1. The 0 conflicts displayed with red (instead of 1 conflicts)
  2. The interactive conflict resolution interface is not shown (although the Interactive mode button is shown as clicked)
> git config -l --system
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
core.autocrlf=false
core.fscache=true
core.symlinks=false
pull.rebase=false
> git config -l --local
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://gitlab.com/mircea.negreanu/test-001.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.test-001.remote=origin
branch.test-001.merge=refs/heads/test-001

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes