cat-file: pass expand_data to print_object_or_die
commit370c9268d13ef54a05ed84b92baa81b75930e58f
authorJeff King <peff@peff.net>
Wed, 11 Dec 2013 23:01:42 +0000 (12 07:01 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 19:27:21 +0000 (12 11:27 -0800)
treef831f09836d4b26fd3dbfbabb54f1385d2bff04e
parentd2446dfd7f3b3f8948142cfb07a0270e2497d93f
cat-file: pass expand_data to print_object_or_die

We currently individually pass the sha1, type, and size
fields calculated by sha1_object_info. However, if we pass
the whole struct, the called function can make more
intelligent decisions about which fields were actually
filled by sha1_object_info.

This patch takes that first refactoring step, passing the
whole struct, so further patches can make those decisions
with less noise in their diffs. There should be no
functional change to this patch (aside from a minor typo fix
in the error message).

As a side effect, we can rename the local variables in the
function to "type" and "size", since the names are no longer
taken.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c