Re: [PATCH 2/2] fast-import: treat cat-blob as a delta base hint for next blob
On Sun, Aug 21, 2011 at 5:17 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 20 quoted lines
> Dmitry Ivankov wrote:
>
>> --- a/fast-import.c
>> +++ b/fast-import.c
>> @@ -2802,7 +2802,12 @@ static void cat_blob(struct object_entry *oe, unsigned char sha1[20])
>> strbuf_release(&line);
>> cat_blob_write(buf, size);
>> cat_blob_write("\n", 1);
>> - free(buf);
>> + if (oe && oe->pack_id == pack_id) {
>> + strbuf_attach(&last_blob.data, buf, size, size);
>> + last_blob.offset = oe->idx.offset;
>> + last_blob.depth = oe->depth;
>> + } else
>> + free(buf);
>> }
>
> Neat. For what it's worth,
> Acked-by: Jonathan Nieder <jrnieder@gmail.com>
>Brilliant!
Acked-by: David Barr <davidbarr@google.com>