diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-01-19 11:20:27 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-01-19 11:20:27 -0500 |
commit | ab439eed6eab4fbd09d185e4e269da2c5589b42e (patch) | |
tree | 05469b50dad961ee64a56ef13eb5b3cbfbf7fcbe /org.eclipse.jgit.test | |
parent | 38b503601a6d3552a558751871906354ba1beca5 (diff) | |
parent | 3d18f65af1341bc1ebc8c5c1e92726d701e5a55e (diff) | |
download | jgit-ab439eed6eab4fbd09d185e4e269da2c5589b42e.tar.gz jgit-ab439eed6eab4fbd09d185e4e269da2c5589b42e.zip |
Merge "Fix patch application WRT windows line endings."
Diffstat (limited to 'org.eclipse.jgit.test')
4 files changed, 28 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
+
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java index 5513b44603..a0a4ddcbf7 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java @@ -178,6 +178,16 @@ public class ApplyCommandTest extends RepositoryTestCase { b.getString(0, b.size(), false)); } + @Test + public void testModifyNL1() throws Exception { + ApplyResult result = init("NL1"); + assertEquals(1, result.getUpdatedFiles().size()); + assertEquals(new File(db.getWorkTree(), "NL1"), result + .getUpdatedFiles().get(0)); + checkFile(new File(db.getWorkTree(), "NL1"), + b.getString(0, b.size(), false)); + } + private static byte[] readFile(final String patchFile) throws IOException { final InputStream in = DiffFormatterReflowTest.class .getResourceAsStream(patchFile); |