]> source.dussan.org Git - jgit.git/commit
Handle missing "ours" stage in WorkingTreeIterator.hasCrLfInIndex() 16/143716/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 11 Jun 2019 11:16:18 +0000 (13:16 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Tue, 11 Jun 2019 12:42:46 +0000 (14:42 +0200)
commit1cfcde48534dcc9510e6e58d422a78fcd156c85f
treeb85cc75f4aa2fd0eb2061908481c679409d25dde
parentfd8d779b5eec614d2cb5a611f2e36f522b34a439
Handle missing "ours" stage in WorkingTreeIterator.hasCrLfInIndex()

In a delete-modify conflict with the deletion as "ours" there may be
no stage 2 in the index. Add appropriate null checks. Add a new test
for this case, and verify that the file gets added with a single LF
after conflict resolution with core.autocrlf=true. This matches the
behavior of canonical git for this case.

Bug: 547724
Change-Id: I1bafdb83d9b78bf85294c78325e818e72fae53bc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java