From 60b81c5a9280e44fa48d533a61f915382b2b9ce2 Mon Sep 17 00:00:00 2001 From: kylezhao Date: Thu, 2 Sep 2021 11:53:48 +0800 Subject: Fix RevWalk.getMergedInto() ignores annotated tags If an annotated tag refers to a commit, we should not ignore it. Change-Id: I77504f93636e9e984540e7d8535ef301adce6a80 Signed-off-by: kylezhao --- .../eclipse/jgit/revwalk/RevWalkMergedIntoTest.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.test') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkMergedIntoTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkMergedIntoTest.java index 2f16aa49e8..2754bd36ae 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkMergedIntoTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkMergedIntoTest.java @@ -99,7 +99,7 @@ public class RevWalkMergedIntoTest extends RevWalkTestCase { createBranch(commit(commit(a)), b); createBranch(commit(commit(i)), c); - assertTrue( rw.isMergedIntoAny(a, getRefs())); + assertTrue(rw.isMergedIntoAny(a, getRefs())); } @Test @@ -125,4 +125,23 @@ public class RevWalkMergedIntoTest extends RevWalkTestCase { assertTrue(rw.isMergedIntoAll(a, getRefs())); } + + @Test + public void testMergeIntoAnnotatedTag() throws Exception { + /* + * a + * | + * b + * / \ + * c v1 (annotated tag) + */ + String c = "refs/heads/c"; + String v1 = "refs/tags/v1"; + final RevCommit a = commit(); + final RevCommit b = commit(a); + createBranch(commit(b), c); + createBranch(tag("v1", b), v1); + + assertTrue(rw.isMergedIntoAll(a, getRefs())); + } } -- cgit v1.2.3