threads / patch / 18302

patchFix sorting of thin packs in PackWriter

Subject: [JGIT PATCH] Fix sorting of thin packs in PackWriter

## tl;dr

One message between Mar 13, 2009 and Mar 13, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Shawn O. Pearce· Mar 13, 2009, 15:45 UTC · lore

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 <spearce@spearce.org>
---
 .../src/org/spearce/jgit/lib/PackWriter.java       |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java +2 −2
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 f9945c4..b878409 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 @@ private ObjectWalk setUpWalker(
 			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);
-- 
1.6.2.288.gc3f22

← back to recent threads