git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fix for "index-pack: rationalize delta resolution code"

From
Nicolas Pitre <nico@cam.org>
Date
Oct 20, 2008, 18:12 UTC
Message-ID
<alpine.LFD.2.00.0810201357340.26244@xanadu.home>

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;
Next: Harvey Harrison
Message 1 of 10 in “fix for "index-pack: rationalize delta resolution code"”
  1. fix for "index-pack: rationalize delta resolution code"Nicolas Pitre, Oct 20, 2008
  2. Harvey HarrisonOct 20, 2008
  3. Harvey HarrisonOct 20, 2008
  4. Marco RoelandOct 20, 2008
  5. Marco RoelandOct 20, 2008
  6. Nicolas PitreOct 20, 2008
  7. Marco RoelandOct 20, 2008
  8. Nicolas PitreOct 20, 2008
  9. Marco RoelandOct 20, 2008
  10. Jeff KingOct 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.