summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2020-04-03 22:04:15 -0700
committerIvan Frade <ifrade@google.com>2020-04-28 22:44:33 -0700
commit003002c1cbc140502eb9066b43c8c56796947f85 (patch)
tree0ee204bacce5168c73a2a9d93c71abf4bc65653a /org.eclipse.jgit.test/tst
parent20bb3124218ed93956450fb30a95b2277db590c5 (diff)
downloadjgit-003002c1cbc140502eb9066b43c8c56796947f85.tar.gz
jgit-003002c1cbc140502eb9066b43c8c56796947f85.zip
revwalk: Introduce bitmap-based object reachability checker
Change-Id: I0b1a2bd21f98894862aab339f8c2e4a417897b89 Signed-off-by: Ivan Frade <ifrade@google.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/BitmappedObjectReachabilityTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/BitmappedObjectReachabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/BitmappedObjectReachabilityTest.java
new file mode 100644
index 0000000000..d2b6e89168
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/BitmappedObjectReachabilityTest.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020, Google LLC and others
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+package org.eclipse.jgit.revwalk;
+
+import org.eclipse.jgit.internal.storage.file.FileRepository;
+import org.eclipse.jgit.internal.storage.file.GC;
+import org.eclipse.jgit.junit.TestRepository;
+
+public class BitmappedObjectReachabilityTest
+ extends ObjectReachabilityTestCase {
+
+ @Override
+ ObjectReachabilityChecker getChecker(
+ TestRepository<FileRepository> repository) throws Exception {
+ // GC generates the bitmaps
+ GC gc = new GC(repository.getRepository());
+ gc.setAuto(false);
+ gc.gc();
+
+ return new BitmappedObjectReachabilityChecker(
+ repository.getRevWalk().toObjectWalkWithSameObjects());
+ }
+
+}