From d1da2780c2488151c7a5d44e08e6bf459e65338d Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Fri, 24 Apr 2015 18:55:31 +0200 Subject: [PATCH] Revert "Let ObjectWalk.markUninteresting also mark the root tree as" The Iff2de881 tried to fix missing tree ..." but introduced severe performance degradation (>10x in some cases) when acting as server (git push) and as client (replication). IOW cure is worse than the disease. This reverts commit c4797fe98655b3d52d0a90ba44fce6e053db3b8b. Change-Id: I4e6056eb352d51277867f857a0cab380eca153ac Signed-off-by: David Ostrovsky --- .../org/eclipse/jgit/revwalk/ObjectWalkTest.java | 15 --------------- .../src/org/eclipse/jgit/revwalk/ObjectWalk.java | 14 +------------- 2 files changed, 1 insertion(+), 28 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 9cbb1c875..dfde7fcf2 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 @@ -214,21 +214,6 @@ public void testCull() throws Exception { assertNull(objw.nextObject()); } - @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 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 b73ccb197..a0af067dc 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 void markUninteresting(RevObject o) throws MissingObjectException, } if (o instanceof RevCommit) - markUninteresting((RevCommit) o); + super.markUninteresting((RevCommit) o); else if (o instanceof RevTree) markTreeUninteresting((RevTree) o); else @@ -242,18 +242,6 @@ else if (o instanceof RevTree) addObject(o); } - @Override - public void markUninteresting(RevCommit c) throws MissingObjectException, - IncorrectObjectTypeException, IOException { - super.markUninteresting(c); - try { - markTreeUninteresting(c.getTree()); - } catch (MissingObjectException e) { - // we don't care if the tree of the commit does not exist locally - } - } - - @Override public void sort(RevSort s) { super.sort(s); boundary = hasRevSort(RevSort.BOUNDARY);