Re: [PATCH] Handle deltified object correctly in git-*-pull family.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-06-03 03:03:29
On Thu, 2 Jun 2005, Junio C Hamano wrote:
> 
> *** Linus, this uses the new helper you wrote.  The interface is
> *** much more pleasant to use.

Can you update it for the fact that I split things up even more?

In particular, see commit 5180cacc202bb20b15981469487eb8d6b0509997: "Split 
up unpack_sha1_file() some more".

You should be able to unpack a delta with just something like this:

	int ret;
	z_stream stream;
	char hdr[100], type[10];
	unsigned long size;

	ret = unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr));
	if (ret < Z_OK)
		return NULL;
	if (parse_sha1_header(hdr, type, &size) < 0)
		return NULL;
	if (strcmp("delta", type))
		return NULL;
	buffer = unpack_sha1_rest(&stream, hdr, size);
	if (!buffer)
		return NULL;
	.. we now have the delta of size "size" in "buffer" ..

ie it now has proper helper functions for every single stage in unpacking
an object.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Jun 03 03:01:53 2005

This archive was generated by hypermail 2.1.8 : 2005-06-03 03:01:53 EST