mailinfo: handle in-body header continuations
[gitweb.git] / streaming.c
index 2ff036a0fa6c8e7b013d061d16baf33045305950..3c48f049d3aa3150573f31a888cc741134d7669e 100644 (file)
@@ -497,7 +497,7 @@ static open_method_decl(incore)
  * Users of streaming interface
  ****************************************************************/
 
-int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *filter,
+int stream_blob_to_fd(int fd, const struct object_id *oid, struct stream_filter *filter,
                      int can_seek)
 {
        struct git_istream *st;
@@ -506,9 +506,12 @@ int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *f
        ssize_t kept = 0;
        int result = -1;
 
-       st = open_istream(sha1, &type, &sz, filter);
-       if (!st)
+       st = open_istream(oid->hash, &type, &sz, filter);
+       if (!st) {
+               if (filter)
+                       free_stream_filter(filter);
                return result;
+       }
        if (type != OBJ_BLOB)
                goto close_and_exit;
        for (;;) {