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

Re: [PATCH] fix multiple issues in index-pack

From
MRMarco Roeland <marco.roeland@xs4all.nl>
Date
Oct 20, 2008, 20:59 UTC
Message-ID
<20081020205925.GA25524@fiberbit.xs4all.nl>
In-Reply-To
<alpine.LFD.2.00.0810201609300.26244@xanadu.home>
On Monday October 20th 2008 at 16:46 Nicolas Pitre wrote:
Show 23 quoted lines
> Since commit 9441b61dc5, two issues affected correct behavior of 
> index-pack:
> 
>  1) The real_type of a delta object is the 'real_type' of its base, not
>     the 'type' which can be a "delta type".  Consequence of this is a
>     corrupted pack index file which only needs to be recreated with a 
>     good index-pack command ('git verify-pack' will flag those).
> 
>  2( The code sequence:
> 
>         result->data = patch_delta(get_base_data(base), base->obj->size,
>                                    delta_data, delta_size, &result->size);
> 
>     has two issues of its own since base->obj->size should instead be
>     base->size as we want the size of the actual object data and not
>     the size of the delta object it is represented by.  Except that 
>     simply replacing base->obj->size with base->size won't make the
>     code more correct as the C language doesn't enforce a particular 
>     ordering for the evaluation of needed arguments for a function call,
>     hence base->size could be pushed on the stack before get_base_data()
>     which initializes base->size is called.
> 
> Signed-off-by: Nicolas Pitre <nico@cam.org>
This patch works for me. Thanks and good detective work.
-- 
Marco Roeland
Previous: Jeff KingNext: Junio C Hamano
Message 3 of 4 in “fix multiple issues in index-pack”
  1. fix multiple issues in index-packNicolas Pitre, Oct 20, 2008
  2. Jeff KingOct 20, 2008
  3. Marco RoelandOct 20, 2008
  4. Junio C HamanoOct 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.