filter-options: expand scaled numbers
[gitweb.git] / streaming.c
index d1e6b2dce6877cb1407ac9d38e65d8b2bae25daa..891f82f51a753d065ce67b111bce86e790801599 100644 (file)
@@ -408,6 +408,15 @@ static read_method_decl(pack_non_delta)
                        st->z_state = z_done;
                        break;
                }
+
+               /*
+                * Unlike the loose object case, we do not have to worry here
+                * about running out of input bytes and spinning infinitely. If
+                * we get Z_BUF_ERROR due to too few input bytes, then we'll
+                * replenish them in the next use_pack() call when we loop. If
+                * we truly hit the end of the pack (i.e., because it's corrupt
+                * or truncated), then use_pack() catches that and will die().
+                */
                if (status != Z_OK && status != Z_BUF_ERROR) {
                        git_inflate_end(&st->z);
                        st->z_state = z_error;
@@ -490,7 +499,7 @@ static struct stream_vtbl incore_vtbl = {
 
 static open_method_decl(incore)
 {
-       st->u.incore.buf = read_object_file_extended(oid, type, &st->size, 0);
+       st->u.incore.buf = read_object_file_extended(the_repository, oid, type, &st->size, 0);
        st->u.incore.read_ptr = 0;
        st->vtbl = &incore_vtbl;