diff options
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java | 15 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java | 9 |
2 files changed, 23 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java index dfde7fcf2c..9cbb1c8752 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java @@ -215,6 +215,21 @@ public class ObjectWalkTest extends RevWalkTestCase { } @Test + public void testMarkUninterestingPropagation() throws Exception { + final RevBlob f = blob("1"); + final RevTree t = tree(file("f", f)); + final RevCommit c1 = commit(t); + final RevCommit c2 = commit(t); + + markUninteresting(c1); + markStart(c2); + + assertSame(c2, objw.next()); + assertNull(objw.next()); + assertNull(objw.nextObject()); + } + + @Test public void testEmptyTreeCorruption() throws Exception { ObjectId bId = ObjectId .fromString("abbbfafe3129f85747aba7bfac992af77134c607"); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java index 730fde9574..ef96b77c5f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java @@ -232,7 +232,7 @@ public class ObjectWalk extends RevWalk { } if (o instanceof RevCommit) - super.markUninteresting((RevCommit) o); + markUninteresting((RevCommit) o); else if (o instanceof RevTree) markTreeUninteresting((RevTree) o); else @@ -243,6 +243,13 @@ public class ObjectWalk extends RevWalk { } @Override + public void markUninteresting(RevCommit c) throws MissingObjectException, + IncorrectObjectTypeException, IOException { + super.markUninteresting(c); + markTreeUninteresting(c.getTree()); + } + + @Override public void sort(RevSort s) { super.sort(s); boundary = hasRevSort(RevSort.BOUNDARY); |