From fdb0a34abfd8b105a08887821d857fcdda2e22c4 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Fri, 18 Mar 2011 13:33:36 +0100 Subject: Refactor ResolveMerger 1. Perform an explicit check for untracked files. 2. Extract 'dirty checks' into separate methods 3. Clean up comments. 4. Tests: also check contents of files not affected by merge. Change-Id: Ieb089668834d0a395c9ab192c555538917dfdc47 Signed-off-by: Philipp Thun --- org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java index 0ef24bd8a5..987e64731e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java @@ -411,6 +411,7 @@ public class MergeCommandTest extends RepositoryTestCase { assertEquals("1\nb(side)\n3\n", read(new File(db.getWorkTree(), "b"))); assertEquals("1\nc(main)\n3\n", read(new File(db.getWorkTree(), "c/c/c"))); + assertEquals("--- dirty ---", read(new File(db.getWorkTree(), "d"))); assertEquals(null, result.getConflicts()); @@ -468,6 +469,7 @@ public class MergeCommandTest extends RepositoryTestCase { assertFalse(new File(db.getWorkTree(), "b").exists()); assertEquals("1\nc(main)\n3\n", read(new File(db.getWorkTree(), "c/c/c"))); + assertEquals("1\nd\n3\n", read(new File(db.getWorkTree(), "d"))); // Do the opposite, be on a branch where we have deleted a file and // merge in a old commit where this file was not deleted @@ -482,6 +484,7 @@ public class MergeCommandTest extends RepositoryTestCase { assertFalse(new File(db.getWorkTree(), "b").exists()); assertEquals("1\nc(main)\n3\n", read(new File(db.getWorkTree(), "c/c/c"))); + assertEquals("1\nd\n3\n", read(new File(db.getWorkTree(), "d"))); } @Test @@ -554,6 +557,7 @@ public class MergeCommandTest extends RepositoryTestCase { assertFalse(new File(db.getWorkTree(), "b").exists()); assertEquals("1\nc(main)\n3\n", read(new File(db.getWorkTree(), "c/c/c"))); + assertEquals("1\nd\n3\n", read(new File(db.getWorkTree(), "d"))); } @Test -- cgit v1.2.3