From 60aae90d4d15d6b35d19941867dad966ddcbe161 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 14 Jun 2010 18:31:14 -0700 Subject: [PATCH] Disable topological sorting in PackWriter Its not strictly required that we sort topologically in order to produce a valid pack file. This was just something that Linus thought would be a good idea to do. In practice its not that important for most repositories. Local file IO quickly falls out of the pattern that topological sorting provides any sort of benefit for, so expending extra resources to enforce it when we make a pack isn't really worth it. I'm removing this sort in the pipeline because later changes would support really efficient COMMIT_TIME_DESC sorting on a non-file storage system, but TOPO sorting would be a bit more ugly to run, due to the in-memory delays it imposes. Change-Id: I0121453461c2140c6917cb10c6df584eb47e5795 Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java index 75cc4662e..e8e5fc21e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java @@ -821,8 +821,7 @@ public class PackWriter { IncorrectObjectTypeException { final ObjectWalk walker = new ObjectWalk(db); walker.setRetainBody(false); - walker.sort(RevSort.TOPO); - walker.sort(RevSort.COMMIT_TIME_DESC, true); + walker.sort(RevSort.COMMIT_TIME_DESC); if (thin) walker.sort(RevSort.BOUNDARY, true);