aboutsummaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-04-16 12:28:52 -0400
committerJunio C Hamano <junkio@cox.net>2007-04-16 17:43:30 -0700
commitadcc70950e594065050c375ace8a039678d2e31f (patch)
treea49e9c1f98a0adbece2b07136ebe76d7c2f9336b /builtin-pack-objects.c
parent8a5a8d6c97e36dbd95361eab1109e4380fe45df4 (diff)
downloadgit-adcc70950e594065050c375ace8a039678d2e31f.tar.gz
git-adcc70950e594065050c375ace8a039678d2e31f.tar.xz
pack-objects: equal objects in size should delta against newer objects
Before finding best delta combinations, we sort objects by name hash, then by size, then by their position in memory. Then we walk the list backwards to test delta candidates. We hope that a bigger size usually means a newer objects. But a bigger address in memory does not mean a newer object. So the last comparison must be reversed. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 62a011e2e..869ca1ab2 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1276,7 +1276,7 @@ static int type_size_sort(const struct object_entry *a, const struct object_entr
return -1;
if (a->size > b->size)
return 1;
- return a < b ? -1 : (a > b);
+ return a > b ? -1 : (a < b); /* newest last */
}
struct unpacked {