diff options
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
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 ba0847bd8d..67e1879d37 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 @@ -327,6 +327,33 @@ public class MergeCommandTest extends RepositoryTestCase { } @Test + public void testMergeTag() throws Exception { + Git git = new Git(db); + + writeTrashFile("a", "a"); + git.add().addFilepattern("a").call(); + RevCommit initialCommit = git.commit().setMessage("initial").call(); + + createBranch(initialCommit, "refs/heads/side"); + checkoutBranch("refs/heads/side"); + + writeTrashFile("b", "b"); + git.add().addFilepattern("b").call(); + RevCommit secondCommit = git.commit().setMessage("side").call(); + Ref tag = git.tag().setAnnotated(true).setMessage("my tag 01") + .setName("tag01").setObjectId(secondCommit).call(); + + checkoutBranch("refs/heads/master"); + + writeTrashFile("a", "a2"); + git.add().addFilepattern("a").call(); + git.commit().setMessage("main").call(); + + MergeResult result = git.merge().include(tag).setStrategy(MergeStrategy.RESOLVE).call(); + assertEquals(MergeStatus.MERGED, result.getMergeStatus()); + } + + @Test public void testMergeMessage() throws Exception { Git git = new Git(db); |