Merge branch 'jk/cat-file-batch-optim'
If somebody wants to only know on-disk footprint of an object without having to know its type or payload size, we can bypass a lot of code to cheaply learn it. * jk/cat-file-batch-optim: Fix some sparse warnings sha1_object_info_extended: pass object_info to helpers sha1_object_info_extended: make type calculation optional packed_object_info: make type lookup optional packed_object_info: hoist delta type resolution to helper sha1_loose_object_info: make type lookup optional sha1_object_info_extended: rename "status" to "type" cat-file: disable object/refname ambiguity check for batch mode
This commit is contained in:
@ -111,11 +111,11 @@ static enum input_source istream_source(const unsigned char *sha1,
|
||||
unsigned long size;
|
||||
int status;
|
||||
|
||||
oi->typep = type;
|
||||
oi->sizep = &size;
|
||||
status = sha1_object_info_extended(sha1, oi);
|
||||
if (status < 0)
|
||||
return stream_error;
|
||||
*type = status;
|
||||
|
||||
switch (oi->whence) {
|
||||
case OI_LOOSE:
|
||||
@ -135,7 +135,7 @@ struct git_istream *open_istream(const unsigned char *sha1,
|
||||
struct stream_filter *filter)
|
||||
{
|
||||
struct git_istream *st;
|
||||
struct object_info oi = {0};
|
||||
struct object_info oi = {NULL};
|
||||
const unsigned char *real = lookup_replace_object(sha1);
|
||||
enum input_source src = istream_source(real, type, &oi);
|
||||
|
||||
|
Reference in New Issue
Block a user