summaryrefslogtreecommitdiff
path: root/streaming.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-25 02:21:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-25 02:21:21 (GMT)
commit356df9bd8df58eb759fedaee8a8d1a7dc0872f8f (patch)
tree3ed41eb0da59c4a6e1b668c3392295ee334f978b /streaming.c
parent2bf3501150145d1f05678c20ab8e8d66f849851f (diff)
parentd099b7173dabdeeb1f339151ac2169b3a91bf631 (diff)
downloadgit-356df9bd8df58eb759fedaee8a8d1a7dc0872f8f.zip
git-356df9bd8df58eb759fedaee8a8d1a7dc0872f8f.tar.gz
git-356df9bd8df58eb759fedaee8a8d1a7dc0872f8f.tar.bz2
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
Diffstat (limited to 'streaming.c')
-rw-r--r--streaming.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/streaming.c b/streaming.c
index efbc3ba..debe904 100644
--- a/streaming.c
+++ b/streaming.c
@@ -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);