sha1_file: support reading from a loose object of unknown type
Update sha1_loose_object_info() to optionally allow it to read from a loose object file of unknown/bogus type; as the function usually returns the type of the object it read in the form of enum for known types, add an optional "typename" field to receive the name of the type in textual form and a flag to indicate the reading of a loose object file of unknown/bogus type. Add parse_sha1_header_extended() which acts as a wrapper around parse_sha1_header() allowing more information to be obtained. Add unpack_sha1_header_to_strbuf() to unpack sha1 headers of unknown/corrupt objects which have a unknown sha1 header size to a strbuf structure. This was written by Junio C Hamano but tested by me. Helped-by: NJunio C Hamano <gitster@pobox.com> Helped-by: NEric Sunshine <sunshine@sunshineco.com> Helped-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Hepled-by: NJeff King <peff@peff.net> Signed-off-by: NKarthik Nayak <karthik.188@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录