]> source.dussan.org Git - jgit.git/commit
Fix patch application WRT windows line endings. 14/6314/5
authorMarkus Duft <markus.duft@salomon.at>
Tue, 12 Jun 2012 05:02:58 +0000 (07:02 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 19 Jan 2013 12:29:02 +0000 (13:29 +0100)
commit3d18f65af1341bc1ebc8c5c1e92726d701e5a55e
tree4574852ddd65687155c6e99dd3a6cca163441606
parent3f0176aea6e77cb39be35f091100f8874693593d
Fix patch application WRT windows line endings.

Previously the result of an application would have been \r\r\n in the
case of windows line endings, as RawText does not touch the \r, and
ApplyCommand adds "\r\n" if this is the ending of the first line in the
target file. Only always adding \n should be ok, since \r\n would be the
result if the file and the patch include windows line endings.

Also add according test.

Change-Id: Ibd4c4948d81bd1c511ecf5fd6c906444930d236e
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1.patch [new file with mode: 0644]
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PostImage [new file with mode: 0644]
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PreImage [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java