summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorkylezhao <kylezhao@tencent.com>2021-08-12 19:37:58 +0800
committerkylezhao <kylezhao@tencent.com>2021-08-13 10:51:16 +0800
commit35eeab41b3eb3fcf6185dd3714c1c5205c5e15c3 (patch)
treeb0459f560a9170c36cfc33855f158c9475acbd38 /org.eclipse.jgit.test
parent65de0d4863f76247fd3a8de94176807c02376de8 (diff)
downloadjgit-35eeab41b3eb3fcf6185dd3714c1c5205c5e15c3.tar.gz
jgit-35eeab41b3eb3fcf6185dd3714c1c5205c5e15c3.zip
RevWalk: getMergedInto's result is wrong on the second call
Make sure the future user can reset all UNINTERESTING commmits after this operation. Signed-off-by: kylezhao <kylezhao@tencent.com> Change-Id: I7549b9ff67bd31acd5dfc92331cb9a30b47b8278
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java
index d9ed0c1c63..200cb6a4fe 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java
@@ -76,6 +76,28 @@ public class RevWalkUtilsReachableTest extends RevWalkTestCase {
}
}
+ @Test
+ public void findBranchesReachableManyTimes() throws Exception {
+ /*
+ * a b
+ * | |
+ * c d
+ */
+ RevCommit a = commit();
+ RevCommit b = commit();
+ RevCommit c = commit(a);
+ RevCommit d = commit(b);
+ Ref branchA = branch("a", a);
+ Ref branchB = branch("b", b);
+ Ref branchC = branch("c", c);
+ Ref branchD = branch("d", d);
+
+ assertContains(a, asList(branchA, branchC));
+ assertContains(b, asList(branchB, branchD));
+ assertContains(c, asList(branchC));
+ assertContains(d, asList(branchD));
+ }
+
private Ref branch(String name, RevCommit dst) throws Exception {
return Git.wrap(db).branchCreate().setName(name)
.setStartPoint(dst.name()).call();