packed_object_info: make type lookup optional
commit412916ee131cf8b0aaac96313ce8686aebe3a47a
authorJeff King <peff@peff.net>
Fri, 12 Jul 2013 06:32:25 +0000 (12 02:32 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jul 2013 17:14:06 +0000 (12 10:14 -0700)
tree797ed05d320bdee54e631d070bae7f118f71b679
parent90191d37ab08f7c6810fa22804dedb23bade02a1
packed_object_info: make type lookup optional

Currently, packed_object_info can save some work by not
calculating the size or disk_size of the object if the
caller is not interested. However, it always calculates the
true object type, whether the caller cares or not, and only
optionally returns the easy-to-get "representation type".

Let's swap these types. The function will now return the
representation type (or OBJ_BAD on failure), and will only
optionally fill in the true type.

There should be no behavior change yet, as the only caller,
sha1_object_info_extended, will always feed it a type
pointer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c