diff options
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java index c95274f68f..bb4b066bf8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java @@ -135,6 +135,31 @@ public class IndexDiffFilterTest extends RepositoryTestCase { } @Test + public void testConflicts() throws Exception { + RevCommit initial = git.commit().setMessage("initial").call(); + writeTrashFile(FILE, "master"); + git.add().addFilepattern(FILE).call(); + RevCommit master = git.commit().setMessage("master").call(); + git.checkout().setName("refs/heads/side") + .setCreateBranch(true).setStartPoint(initial).call(); + writeTrashFile(FILE, "side"); + git.add().addFilepattern(FILE).call(); + RevCommit side = git.commit().setMessage("side").call(); + assertFalse(git.merge().include("master", master).call() + .getMergeStatus() + .isSuccessful()); + assertEquals(read(FILE), + "<<<<<<< HEAD\nside\n=======\nmaster\n>>>>>>> master\n"); + writeTrashFile(FILE, "master"); + + TreeWalk treeWalk = createTreeWalk(side); + int count = 0; + while (treeWalk.next()) + count++; + assertEquals(2, count); + } + + @Test public void testFileInFolderCommitted() throws Exception { RevCommit commit = writeFileInFolderAndCommit(); TreeWalk treeWalk = createTreeWalk(commit); |