git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix for "index-pack: rationalize delta resolution code"
@ 2008-10-20 18:12 Nicolas Pitre
  2008-10-20 18:37 ` Harvey Harrison
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nicolas Pitre @ 2008-10-20 18:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jeff King

My bad.  A small detail went through the crack: the real_type of
a delta object is the real_type of its base object.

Without this, the created index will be wrong as the actual object SHA1
won't match the object.

Signed-off-by: Nicolas Pitre <nico@cam.org>
---

If you got a corrupted .idx file because of this ('git verify-pack' 
should tell) then just toss it and recreate with a fixed 'git 
index-pack'.

Could anyone having problems fetching from kernel.org with git from the 
next branch confirm that this also fixes that? Thanks.

diff --git a/index-pack.c b/index-pack.c
index 0a917d7..8287ebf 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -517,7 +517,7 @@ static void resolve_delta(struct object_entry *delta_obj,
 	void *delta_data;
 	unsigned long delta_size;
 
-	delta_obj->real_type = base->obj->type;
+	delta_obj->real_type = base->obj->real_type;
 	delta_data = get_data_from_pack(delta_obj);
 	delta_size = delta_obj->size;
 	result->obj = delta_obj;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-10-20 20:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 18:12 [PATCH] fix for "index-pack: rationalize delta resolution code" Nicolas Pitre
2008-10-20 18:37 ` Harvey Harrison
2008-10-20 19:07   ` Harvey Harrison
2008-10-20 19:14 ` Marco Roeland
2008-10-20 19:20   ` Marco Roeland
2008-10-20 19:27     ` Nicolas Pitre
2008-10-20 19:36       ` Marco Roeland
2008-10-20 20:04         ` Nicolas Pitre
2008-10-20 20:12           ` Marco Roeland
2008-10-20 20:10 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).