X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=9cab99ae7c2b1e59db7be26d79d287254db21211;hb=155d12912fec6c60ead6d6c1febda5fa6e6eb128;hp=1d799f793a936a696cea86deb36fa2bdb04c29f4;hpb=709a9e5771ddb32995df6a0622e5d643baa4487a;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 1d799f79..9cab99ae 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -828,6 +828,25 @@ static unsigned long unpack_object_header(struct packed_git *p, unsigned long of return offset; } +int check_reuse_pack_delta(struct packed_git *p, unsigned long offset, + unsigned char *base, unsigned long *sizep, + enum object_type *kindp) +{ + unsigned long ptr; + int status = -1; + + use_packed_git(p); + ptr = offset; + ptr = unpack_object_header(p, ptr, kindp, sizep); + if (*kindp != OBJ_DELTA) + goto done; + memcpy(base, p->pack_base + ptr, 20); + status = 0; + done: + unuse_packed_git(p); + return status; +} + void packed_object_info_detail(struct pack_entry *e, char *type, unsigned long *size,