Re: [PATCH] [RFC] Making use of bitmaps for thin objects
- From
Jeff King <peff@peff.net>
- Date
- Jan 6, 2014, 20:38 UTC
- Message-ID
- <20140106203847.GA643@sigill.intra.peff.net>
- In-Reply-To
- <20140106145723.GA15489@sigill.intra.peff.net>
On Mon, Jan 06, 2014 at 09:57:23AM -0500, Jeff King wrote:
Show 22 quoted lines
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index c733379..0cff874 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -1402,6 +1402,19 @@ static void check_object(struct object_entry *entry)
> base_entry->delta_child = entry;
> unuse_pack(&w_curs);
> return;
> + } else if(base_ref && bitmap_have(base_ref)) {
> + entry->type = entry->in_pack_type;
> + entry->delta_size = entry->size;
> + /*
> + * XXX we'll leak this, but it's probably OK
> + * since we'll exit immediately after the packing
> + * is done
> + */
> + entry->delta = xcalloc(1, sizeof(*entry->delta));
> + hashcpy(entry->delta->idx.sha1, base_ref);
> + entry->delta->preferred_base = 1;
> + unuse_pack(&w_curs);
> + return;
> }Just reading over this again, the conditional here should obviously be checking "thin" (which needs to become a global, as in your patch).
-Peff