diff options
author | Markus Duft <markus.duft@salomon.at> | 2012-06-12 07:02:58 +0200 |
---|---|---|
committer | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-01-19 13:29:02 +0100 |
commit | 3d18f65af1341bc1ebc8c5c1e92726d701e5a55e (patch) | |
tree | 4574852ddd65687155c6e99dd3a6cca163441606 /org.eclipse.jgit.test/tst-rsrc | |
parent | 3f0176aea6e77cb39be35f091100f8874693593d (diff) | |
download | jgit-3d18f65af1341bc1ebc8c5c1e92726d701e5a55e.tar.gz jgit-3d18f65af1341bc1ebc8c5c1e92726d701e5a55e.zip |
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
Diffstat (limited to 'org.eclipse.jgit.test/tst-rsrc')
3 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1.patch new file mode 100644 index 0000000000..ba5a4fc25d --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1.patch @@ -0,0 +1,10 @@ +diff --git a/NL1 b/NL1 +index 68abad7..b14088c 100644 +--- a/NL1 ++++ b/NL1 +@@ -1,4 +1,4 @@ + a
+-b
++d
+ c
+
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PostImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PostImage new file mode 100644 index 0000000000..b14088c045 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PostImage @@ -0,0 +1,4 @@ +a
+d
+c
+
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PreImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PreImage new file mode 100644 index 0000000000..68abad7d93 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/NL1_PreImage @@ -0,0 +1,4 @@ +a
+b
+c
+
|