more lightweight revalidation while reusing deflated stream in packing
When copying from an existing pack and when copying from a loose
object with new style header, the code makes sure that the piece
we are going to copy out inflates well and inflate() consumes
the data in full while doing so.
The check to see if the xdelta really apply is quite expensive
as you described, because you would need to have the image of
the base object which can be represented as a delta against
something else.
Signed-off-by: Junio C Hamano <junkio@cox.net>
@ -243,41 +243,61 @@ static int encode_header(enum object_type type, unsigned long size, unsigned cha
@@ -243,41 +243,61 @@ static int encode_header(enum object_type type, unsigned long size, unsigned cha
return n;
}
static int revalidate_one(struct object_entry *entry,
void *data, char *type, unsigned long size)
static int check_inflate(unsigned char *data, unsigned long len, unsigned long expect)