diff options
author | kylezhao <kylezhao@tencent.com> | 2021-09-02 11:53:48 +0800 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-10-08 12:05:48 +0200 |
commit | 60b81c5a9280e44fa48d533a61f915382b2b9ce2 (patch) | |
tree | 36243ccc86b70406db0d23c4c0da486e95fb1695 /org.eclipse.jgit.test | |
parent | c5b30547355327c1536593cc7c4213d4949f5024 (diff) | |
download | jgit-60b81c5a9280e44fa48d533a61f915382b2b9ce2.tar.gz jgit-60b81c5a9280e44fa48d533a61f915382b2b9ce2.zip |
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 <kylezhao@tencent.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkMergedIntoTest.java | 21 |
1 files changed, 20 insertions, 1 deletions
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())); + } } |