From 9c43257e0ed86ec41963ee4c7607963e77f5a8ad Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 13 Mar 2009 08:45:25 -0700 Subject: [PATCH] Fix sorting of thin packs in PackWriter We must retain the TOPO and COMMIT_TIME_DESC rules when we add in BOUNDARY for a thin pack, otherwise the resulting thin pack won't match the expected ordering. Its a non-critical error to sort the pack wrong, but it may cause the client to skip around the pack data more frequently during access. Signed-off-by: Shawn O. Pearce Signed-off-by: Robin Rosenberg --- org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java index f9945c40..b8784094 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java @@ -765,10 +765,10 @@ public class PackWriter { throws MissingObjectException, IOException, IncorrectObjectTypeException { final ObjectWalk walker = new ObjectWalk(db); - walker.sort(RevSort.TOPO, true); + walker.sort(RevSort.TOPO); walker.sort(RevSort.COMMIT_TIME_DESC, true); if (thin) - walker.sort(RevSort.BOUNDARY); + walker.sort(RevSort.BOUNDARY, true); for (ObjectId id : interestingObjects) { RevObject o = walker.parseAny(id); -- 2.11.4.GIT