aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2024-02-21 15:28:03 -0800
committerIvan Frade <ifrade@google.com>2024-02-21 15:28:03 -0800
commitf11d1365faad2dcac73570f53f1e05e86f058cde (patch)
tree4e0e403e338655bf2828e6379a8e89880690a649 /org.eclipse.jgit.test
parent90674ab152102b16081bd109d7f72bc37c4040ab (diff)
downloadjgit-f11d1365faad2dcac73570f53f1e05e86f058cde.tar.gz
jgit-f11d1365faad2dcac73570f53f1e05e86f058cde.zip
Revert "StartGenerator: Fix parent rewrite with non-default RevFilter"
This reverts commit db5ce6b5c24408ae27eb6fa0b6289d51b129baeb. Reason to revert: This change utilizes the RewriteGenerator even in absence of a path, making the walk lengthy. Change-Id: I5ffa6e8fead328191348c1e46828bf8c75ae1e42
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterWithRewriteParentsTest.java112
2 files changed, 0 insertions, 113 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java
index f67a623ff6..298facfd15 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java
@@ -21,7 +21,6 @@ import org.junit.Test;
public class TreeRevFilterTest extends RevWalkTestCase {
private RevFilter treeRevFilter() {
- rw.setRewriteParents(false);
return new TreeRevFilter(rw, TreeFilter.ANY_DIFF);
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterWithRewriteParentsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterWithRewriteParentsTest.java
deleted file mode 100644
index 100f2e4164..0000000000
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterWithRewriteParentsTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2023, 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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.eclipse.jgit.revwalk.filter.RevFilter;
-import org.eclipse.jgit.treewalk.filter.TreeFilter;
-import org.junit.Test;
-
-public class TreeRevFilterWithRewriteParentsTest extends RevWalkTestCase {
- private RevFilter treeRevFilter() {
- rw.setRewriteParents(true);
- return new TreeRevFilter(rw, TreeFilter.ANY_DIFF);
- }
-
- @Test
- public void testStringOfPearls_FilePath1()
- throws Exception {
- RevCommit a = commit(tree(file("d/f", blob("a"))));
- RevCommit b = commit(tree(file("d/f", blob("a"))), a);
- RevCommit c = commit(tree(file("d/f", blob("b"))), b);
- rw.setRevFilter(treeRevFilter());
- markStart(c);
-
- assertCommit(c, rw.next());
- assertEquals(1, c.getParentCount());
- assertCommit(a, c.getParent(0));
-
- assertCommit(a, rw.next()); // b was skipped
- assertEquals(0, a.getParentCount());
- assertNull(rw.next());
- }
-
- @Test
- public void testStringOfPearls_FilePath2() throws Exception {
- RevCommit a = commit(tree(file("d/f", blob("a"))));
- RevCommit b = commit(tree(file("d/f", blob("a"))), a);
- RevCommit c = commit(tree(file("d/f", blob("b"))), b);
- RevCommit d = commit(tree(file("d/f", blob("b"))), c);
- rw.setRevFilter(treeRevFilter());
- markStart(d);
-
- // d was skipped
- assertCommit(c, rw.next());
- assertEquals(1, c.getParentCount());
- assertCommit(a, c.getParent(0));
-
- // b was skipped
- assertCommit(a, rw.next());
- assertEquals(0, a.getParentCount());
- assertNull(rw.next());
- }
-
- @Test
- public void testStringOfPearls_DirPath2() throws Exception {
- RevCommit a = commit(tree(file("d/f", blob("a"))));
- RevCommit b = commit(tree(file("d/f", blob("a"))), a);
- RevCommit c = commit(tree(file("d/f", blob("b"))), b);
- RevCommit d = commit(tree(file("d/f", blob("b"))), c);
- rw.setRevFilter(treeRevFilter());
- markStart(d);
-
- // d was skipped
- assertCommit(c, rw.next());
- assertEquals(1, c.getParentCount());
- assertCommit(a, c.getParent(0));
-
- // b was skipped
- assertCommit(a, rw.next());
- assertEquals(0, a.getParentCount());
- assertNull(rw.next());
- }
-
- @Test
- public void testStringOfPearls_FilePath3() throws Exception {
- RevCommit a = commit(tree(file("d/f", blob("a"))));
- RevCommit b = commit(tree(file("d/f", blob("a"))), a);
- RevCommit c = commit(tree(file("d/f", blob("b"))), b);
- RevCommit d = commit(tree(file("d/f", blob("b"))), c);
- RevCommit e = commit(tree(file("d/f", blob("b"))), d);
- RevCommit f = commit(tree(file("d/f", blob("b"))), e);
- RevCommit g = commit(tree(file("d/f", blob("b"))), f);
- RevCommit h = commit(tree(file("d/f", blob("b"))), g);
- RevCommit i = commit(tree(file("d/f", blob("c"))), h);
- rw.setRevFilter(treeRevFilter());
- markStart(i);
-
- assertCommit(i, rw.next());
- assertEquals(1, i.getParentCount());
- assertCommit(c, i.getParent(0));
-
- // h..d was skipped
- assertCommit(c, rw.next());
- assertEquals(1, c.getParentCount());
- assertCommit(a, c.getParent(0));
-
- // b was skipped
- assertCommit(a, rw.next());
- assertEquals(0, a.getParentCount());
- assertNull(rw.next());
- }
-}