cache: convert get_graft_file to handle arbitrary repositories
[gitweb.git] / streaming.c
index 46fabee3aa43840fbe93dfd0e12eff85d5e81cb2..d1e6b2dce6877cb1407ac9d38e65d8b2bae25daa 100644 (file)
@@ -3,6 +3,9 @@
  */
 #include "cache.h"
 #include "streaming.h"
+#include "repository.h"
+#include "object-store.h"
+#include "replace-object.h"
 #include "packfile.h"
 
 enum input_source {
@@ -114,7 +117,7 @@ static enum input_source istream_source(const struct object_id *oid,
 
        oi->typep = type;
        oi->sizep = &size;
-       status = oid_object_info_extended(oid, oi, 0);
+       status = oid_object_info_extended(the_repository, oid, oi, 0);
        if (status < 0)
                return stream_error;
 
@@ -137,7 +140,7 @@ struct git_istream *open_istream(const struct object_id *oid,
 {
        struct git_istream *st;
        struct object_info oi = OBJECT_INFO_INIT;
-       const struct object_id *real = lookup_replace_object(oid);
+       const struct object_id *real = lookup_replace_object(the_repository, oid);
        enum input_source src = istream_source(real, type, &oi);
 
        if (src < 0)
@@ -335,7 +338,8 @@ static struct stream_vtbl loose_vtbl = {
 
 static open_method_decl(loose)
 {
-       st->u.loose.mapped = map_sha1_file(oid->hash, &st->u.loose.mapsize);
+       st->u.loose.mapped = map_sha1_file(the_repository,
+                                          oid->hash, &st->u.loose.mapsize);
        if (!st->u.loose.mapped)
                return -1;
        if ((unpack_sha1_header(&st->z,