git-sh-setup.sh: add variable to use the stuck-long mode
[gitweb.git] / streaming.c
index efbc3babf157ab2c355c80eabeacea5cd6d77dab..d7c9f32f0ce98112ddd4d4a8499b227b181e09e6 100644 (file)
@@ -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);
+       status = sha1_object_info_extended(sha1, oi, 0);
        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);
 
@@ -538,7 +538,7 @@ int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *f
                        goto close_and_exit;
        }
        if (kept && (lseek(fd, kept - 1, SEEK_CUR) == (off_t) -1 ||
-                    write(fd, "", 1) != 1))
+                    xwrite(fd, "", 1) != 1))
                goto close_and_exit;
        result = 0;