Convert remaining callers of sha1_object_info_extended to object_id
[gitweb.git] / streaming.c
index 5892b50bd89c3c66bdb541ca0100f0671834a542..042d6082e83660773843ffc68841cd0c05c252b2 100644 (file)
@@ -111,10 +111,13 @@ static enum input_source istream_source(const unsigned char *sha1,
 {
        unsigned long size;
        int status;
+       struct object_id oid;
+
+       hashcpy(oid.hash, sha1);
 
        oi->typep = type;
        oi->sizep = &size;
-       status = sha1_object_info_extended(sha1, oi, 0);
+       status = sha1_object_info_extended(oid.hash, oi, 0);
        if (status < 0)
                return stream_error;
 
@@ -130,14 +133,14 @@ static enum input_source istream_source(const unsigned char *sha1,
        }
 }
 
-struct git_istream *open_istream(const unsigned char *sha1,
+struct git_istream *open_istream(const struct object_id *oid,
                                 enum object_type *type,
                                 unsigned long *size,
                                 struct stream_filter *filter)
 {
        struct git_istream *st;
        struct object_info oi = OBJECT_INFO_INIT;
-       const unsigned char *real = lookup_replace_object(sha1);
+       const unsigned char *real = lookup_replace_object(oid->hash);
        enum input_source src = istream_source(real, type, &oi);
 
        if (src < 0)
@@ -507,7 +510,7 @@ int stream_blob_to_fd(int fd, const struct object_id *oid, struct stream_filter
        ssize_t kept = 0;
        int result = -1;
 
-       st = open_istream(oid->hash, &type, &sz, filter);
+       st = open_istream(oid, &type, &sz, filter);
        if (!st) {
                if (filter)
                        free_stream_filter(filter);