aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2010-10-28 15:54:36 -0400
committerCode Review <codereview-daemon@eclipse.org>2010-10-28 15:54:36 -0400
commit7f939ba86e4c4ce379b4dc62045109a91e97dd72 (patch)
treed7f481de81afbcdb87efd4d3a9675029ae93b1fa /org.eclipse.jgit.test/tst
parent7668a462829b12e4f6a192c43157152ef63ff305 (diff)
parentbeeb1f6d08a907493b3660837fd4059322ca969a (diff)
downloadjgit-7f939ba86e4c4ce379b4dc62045109a91e97dd72.tar.gz
jgit-7f939ba86e4c4ce379b4dc62045109a91e97dd72.zip
Merge "Fix Severe Bug in Merge Algorithm"
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
index 47f3292515..b51329e29f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
@@ -98,6 +98,7 @@ public class MergeAlgorithmTest extends TestCase {
String replace_BCDEGI_by_ZZZZZZ=A+Z+Z+Z+Z+F+Z+H+Z+J;
String replace_CEFGHJ_by_YYYYYY=A+B+Y+D+Y+Y+Y+Y+I+Y;
String replace_BDE_by_ZZY=A+Z+C+Z+Y+F+G+H+I+J;
+ String delete_C=A+B+D+E+F+G+H+I+J;
/**
* Check for a conflict where the second text was changed similar to the
@@ -190,6 +191,16 @@ public class MergeAlgorithmTest extends TestCase {
merge(base, replace_C_by_Z, replace_C_by_Z));
}
+ /**
+ * Check that a deleted vs. a modified line shows up as conflict (see Bug
+ * 328551)
+ *
+ * @throws IOException
+ */
+ public void testDeleteVsModify() throws IOException {
+ assertEquals(A+B+XXX_0+XXX_1+Z+XXX_2+D+E+F+G+H+I+J, merge(base, delete_C, replace_C_by_Z));
+ }
+
private String merge(String commonBase, String ours, String theirs) throws IOException {
MergeResult r=MergeAlgorithm.merge(RawTextComparator.DEFAULT, new RawText(Constants.encode(commonBase)), new RawText(Constants.encode(ours)), new RawText(Constants.encode(theirs)));
ByteArrayOutputStream bo=new ByteArrayOutputStream(50);